Mailing List Archive

[Bricolage #224] Ability to limit Burner "depth" for publish_another and like calls
// Add your reply above here
==================================================
Nick Legg updated this ticket at November 22nd, 2010 @ 05:28 PM

Our autohandler has a 'cleanup' block which triggers related stories to be republished. The cleanup block is shown below:

<%cleanup>
# Make it always return true to disable the triggered publishes.
# return unless $burner->get_mode == PUBLISH_MODE;
#$burner->publish_another($_) for ref($story)->list({
# related_story_id => $story->get_id,
# active => 1,
# unexpired => 1,
# published_version => 1,
#});
</%cleanup>

When we uncomment this section and try to publish stories we are met with an extreme drop in publishing rate and our error log fills up rapidly with template warnings [.these are NOT a result of this cleanup block directly, these errors exist in our templates and happen on each preview/publish] to the point the disk partition fills up. While rotating the log would stop the hard crash, the larger issue appears to be a loop that occurs when attempting to republish related stories and the same story is being burned over and over.

Some of our templates use publish_another() or similar methods to perform like tasks. Do these templates conflict with the cleanup block?

We did notice that with this section of code enabled not only are the stories related to a particular story_id republished but all stories related to each of those stories is also republished and so on until the recursion is complete. This could republish a large number of assets which could interfere with others publishing.

We only want the first level of related related stories to be republished so to combat this an stop the recursion at a specified level we have added some new functionality to the burner which stops the recursion at a specified depth.

With this "depth" patch applied we now have a cleanup block in our autohandler that looks like this:
<%cleanup>
# Make it always return true to disable the triggered publishes.
return unless $burner->get_mode == PUBLISH_MODE;
$burner->set_max_depth(1);
$burner->publish_another($_) for ref($story)->list({
related_story_id => $story->get_id,
exclude_id => $story->get_id,
active => 1,
unexpired => 1,
published_version => 1,
});
</%cleanup>

I've attached a diff created from our 1.10.9 install for review.
--------------------------------------------------------------------------------

Assigned: Bugs (at bricolage)
State: new
Assets:
- burner-depth.patch http://bricolage.lighthouseapp.com/projects/29601/tickets/224/a/783263/burner-depth.patch
View this ticket online: http://bricolage.lighthouseapp.com/projects/29601/tickets/224-ability-to-limit-burner-depth-for-publish_another-and-like-calls
Stop being notified of this ticket's changes: http://bricolage.lighthouseapp.com/projects/29601/tickets/224-ability-to-limit-burner-depth-for-publish_another-and-like-calls/watch
Update your Profile: http://bricolage.lighthouseapp.com/profile
Support: support@lighthouseapp.com or http://help.lighthouseapp.com
[Bricolage #224] Ability to limit Burner "depth" for publish_another and like calls [ In reply to ]
// Add your reply above here
==================================================
Nick Legg updated this ticket at November 22nd, 2010 @ 05:28 PM


--------------------------------------------------------------------------------

Assigned: Bugs (at bricolage)
State: new
View this ticket online: http://bricolage.lighthouseapp.com/projects/29601/tickets/224-ability-to-limit-burner-depth-for-publish_another-and-like-calls
Stop being notified of this ticket's changes: http://bricolage.lighthouseapp.com/projects/29601/tickets/224-ability-to-limit-burner-depth-for-publish_another-and-like-calls/watch
Update your Profile: http://bricolage.lighthouseapp.com/profile
Support: support@lighthouseapp.com or http://help.lighthouseapp.com
[Bricolage #224] Ability to limit Burner "depth" for publish_another and like calls [ In reply to ]
// Add your reply above here
==================================================
theory updated this ticket at November 22nd, 2010 @ 05:39 PM
* State changed from "new" to "invalid"
So I think that this isn't necessary in Bricolage 2.0, which has a new feature where not story is published more than once in a single call to publish(). This will allow you to avoid the infinite loop.

You still might want to publish only one level deep, of course. But in that case, I'd just use `notes()` like so:

<%cleanup>
# Make it always return true to disable the triggered publishes.
return if $burner->get_mode != PUBLISH_MODE || $burner->notes('in_another');
$burner->notes(in_another => 1);
$burner->publish_another($_) for ref($story)->list({
related_story_id => $story->get_id,
exclude_id => $story->get_id,
active => 1,
unexpired => 1,
published_version => 1,
});
$burner->notes(in_another => 0);
</%cleanup>
--------------------------------------------------------------------------------

Assigned: Bugs (at bricolage)
State: invalid
View this ticket online: http://bricolage.lighthouseapp.com/projects/29601/tickets/224-ability-to-limit-burner-depth-for-publish_another-and-like-calls
Stop being notified of this ticket's changes: http://bricolage.lighthouseapp.com/projects/29601/tickets/224-ability-to-limit-burner-depth-for-publish_another-and-like-calls/watch
Update your Profile: http://bricolage.lighthouseapp.com/profile
Support: support@lighthouseapp.com or http://help.lighthouseapp.com
[Bricolage #224] Ability to limit Burner "depth" for publish_another and like calls [ In reply to ]
// Add your reply above here
==================================================
theory updated this ticket at November 22nd, 2010 @ 08:06 PM
* Milestone changed from "" to "2.0.1"

--------------------------------------------------------------------------------

Assigned: Bugs (at bricolage)
State: invalid
Milestone: 2.0.1
View this ticket online: http://bricolage.lighthouseapp.com/projects/29601/tickets/224-ability-to-limit-burner-depth-for-publish_another-and-like-calls
Stop being notified of this ticket's changes: http://bricolage.lighthouseapp.com/projects/29601/tickets/224-ability-to-limit-burner-depth-for-publish_another-and-like-calls/watch
Update your Profile: http://bricolage.lighthouseapp.com/profile
Support: support@lighthouseapp.com or http://help.lighthouseapp.com