Re: [web2py] Re: recognizing web2py restart

2012-06-19 Thread Derek
Look in main.py for the httpserver class. you could handle the cleanup in the stop function, or you could look at widget.py and add a line after the start server function to do the cleanup. On Friday, June 8, 2012 2:04:17 PM UTC-7, Jonathan Lundell wrote: > > On Jun 8, 2012, at 12:49 PM, Derek w

Re: [web2py] Re: recognizing web2py restart

2012-06-08 Thread Jonathan Lundell
On Jun 8, 2012, at 12:49 PM, Derek wrote: > Well, as an academic exercise, to recognize a user-initiated restart, i'd > hook into the shutdown function to manage clearing the cache and all that. I didn't know there was one.

Re: [web2py] Re: recognizing web2py restart

2012-06-08 Thread Derek
Well, as an academic exercise, to recognize a user-initiated restart, i'd hook into the shutdown function to manage clearing the cache and all that. On Thursday, June 7, 2012 3:47:14 PM UTC-7, Jonathan Lundell wrote: > > On Jun 7, 2012, at 2:03 PM, Cliff Kachinske wrote: > > It's not unusual to h

Re: [web2py] Re: recognizing web2py restart

2012-06-07 Thread Jonathan Lundell
On Jun 7, 2012, at 2:03 PM, Cliff Kachinske wrote: > It's not unusual to have a setup like this: > > development box -> test box -> production box > > The test box is a clone of the production box, as much as you can make it so. > No reason why it couldn't be a virtual machine, but it has to be

Re: [web2py] Re: recognizing web2py restart

2012-06-07 Thread Cliff Kachinske
It's not unusual to have a setup like this: development box -> test box -> production box The test box is a clone of the production box, as much as you can make it so. No reason why it couldn't be a virtual machine, but it has to be there to prevent surprises due to different patch/version lev

Re: [web2py] Re: recognizing web2py restart

2012-06-07 Thread Derek
Ah, it seemed to me this is just a development environment and thus you wouldn't need this feature in production? On Thursday, May 31, 2012 2:47:51 PM UTC-7, Jonathan Lundell wrote: > > On May 31, 2012, at 2:32 PM, Derek wrote: > > If you're blowing away your database, why don't you clear memcach

Re: [web2py] Re: recognizing web2py restart

2012-05-31 Thread Jonathan Lundell
On May 31, 2012, at 2:32 PM, Derek wrote: > If you're blowing away your database, why don't you clear memcached when you > blow away your database? I don't see how this is a web2py issue. One possible reason: web2py (and in particular my application) aren't necessarily the only memcached clients

[web2py] Re: recognizing web2py restart

2012-05-31 Thread Derek
If you're blowing away your database, why don't you clear memcached when you blow away your database? I don't see how this is a web2py issue. On Wednesday, May 30, 2012 7:10:13 PM UTC-7, Jonathan Lundell wrote: > > I've got an application that uses memcached. I'd like to recognize when > web2py

Re: [web2py] Re: recognizing web2py restart

2012-05-30 Thread David McKeone
Warning: I'm still new to python and web2py so this may be wacky, but... Could you make a cached method with side-effects and an infinite expiry? Since RAM would always be cleared on a restart it would theoretically only ever be run on cold start. first_time = False def first_start_check():

Re: [web2py] Re: recognizing web2py restart

2012-05-30 Thread Jonathan Lundell
On May 30, 2012, at 7:13 PM, Massimo Di Pierro wrote: > you can make a cron job in admin @reboot It'd have to be soft cron, yes? And it wouldn't run until after my app services its first request after restart, if I remember my soft cron logic aright. > > On Wednesday, 30 May 2012 21:10:13 UTC-5

Re: [web2py] Re: recognizing web2py restart

2012-05-30 Thread Jonathan Lundell
On May 30, 2012, at 7:13 PM, Massimo Di Pierro wrote: > you can make a cron job in admin @reboot I'll look at that, thanks. > > On Wednesday, 30 May 2012 21:10:13 UTC-5, Jonathan Lundell wrote: > I've got an application that uses memcached. I'd like to recognize when > web2py gets restarted (m

[web2py] Re: recognizing web2py restart

2012-05-30 Thread Massimo Di Pierro
you can make a cron job in admin @reboot On Wednesday, 30 May 2012 21:10:13 UTC-5, Jonathan Lundell wrote: > > I've got an application that uses memcached. I'd like to recognize when > web2py gets restarted (mod_wsgi, fwiw) so I can flush my cache. No doubt I > can figure something out, but I'm