leggn at denison
Jul 14, 2011, 5:41 AM
Post #3 of 11
On 7/13/2011 2:15 AM, David E. Wheeler wrote:
> On Jul 12, 2011, at 1:09 PM, Nick Legg wrote:
>> Can someone explain why an asset is republished and then expired upon deactivation? I've tried using bric_soap and a simple perl script using the bric API ($asset->deactivate()). I'm not understanding why the republish step is being created, but I definitely want the expire job to happen.
> You likely have the EXPIRE_ON_DEACTIVATE bricolage.conf directive enabled, and that's what makes the republish jobs get scheduled when you call deactivate()&& save().
This is correct; I do have EXPIRE_ON_DEACTIVATE enabled.
>> I'm trying to deactivate a rather large chunk of assets (20,000+) and don't want it to bog down my bric_queued for a couple hours.
> It probably won't, though you should test it with a few. When those republish jobs are scheduled, the "expire" boolean should be set to TRUE in the database. When the job executes, it won't actually run the story through a template and distribute it, but will just delete it from the destination server.
> That's the theory anyway. Poke at it a bit to confirm I'm not lying.
I've re-published and re-expired a few stories to test this. Upon
ordering a story to deactivate, an Expire job is created. The 'expire'
field is true for this job. This Expire job splits into n Distribute
jobs (one for each of my Output Channels, but that's beside the point).
The Distribute jobs actually execute and deliver the file to the
destination server. The 'expire' field is false for these jobs. Once
this is complete, each Distribute job births a child Expire job (again,
one for each OC). The 'expire' field is true for these jobs. This is
where the actual deletion of the file from the server happens.
It seems odd to me that Bricolage distributes the file(s) immediately
before expiring them when deactivating an asset; on the other hand, when
a scheduled expire job eventually transpires it does not pre-distribute
the file prior to expiring it (I see failed expires occasionally due to
this behavior, where it cannot delete the file because the file does not
exist on the destination server).