[Catalyst] Proper way to perform cleanups on server shutdown?

Matt S Trout dbix-class at trout.me.uk
Thu Jun 28 01:11:49 GMT 2007


On Wed, Jun 27, 2007 at 02:38:34PM -0700, John Napiorkowski wrote:
> Hi,
> 
> I'm finding that the way I usually catch shutdown
> signals to perform cleanup is not working.  Setting
> %SIG handlers doesn't seem to do it and I'm not
> finding that DESTROY methods are getting fired off in
> the expected way.
> 
> For example if I set a $SIG{INT} handler in the
> application class (MyApp.pm) that get's called if I am
> running the development server foregrounded and the
> interrupt it with a 'ctrl-c', but it doesn't get
> called if the development server is deamonized and I
> kill the process.  $SIG{QUIT} doesn't seem to do it. 
> DESTROY doesn't seem to every get called.

Add some better traces - I suspect this is either (a) a DBIC problem fixed
in 0.08 or (b) a problem that isn't that you didn't give us a test case for
yet :)

-- 
      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director    Want a managed development or deployment platform?
 Shadowcat Systems Ltd.  Contact mst (at) shadowcatsystems.co.uk for a quote
http://chainsawblues.vox.com/             http://www.shadowcatsystems.co.uk/ 



More information about the Catalyst mailing list