Proper procedure for creating scheduled tasks

2010-10-05 Thread Alec Munro
Hi List, I have a situation where my Pylons app needs to do something every minute, while still being responsive to client requests. My solution to this was to create a thread within app_globals, and have this thread do it's thing, then sleep for a minute. Functionally, this does appear to do wha

Re: Proper procedure for creating scheduled tasks

2010-10-06 Thread Alec Munro
I think that may have been just what I needed. When I started this project, it was stateless, not using a database. I added the database afterwards, but I didn't change the basecontroller. Got to clean some things up. :) Thanks! On Oct 6, 10:45 am, Graham Higgins wrote: > -BEGIN PGP SIGNED

Re: Proper procedure for creating scheduled tasks

2010-10-15 Thread Hollister
I typically prefer to run these kinds of things outside the web app itself, usually with a Python script called from a cron job. You can access your app's settings and DB by creating a package and putting code like this in the __init__.py: from paste.deploy import appconfig from pylons import conf

Re: Proper procedure for creating scheduled tasks

2010-10-15 Thread Hollister
I typically prefer to run these kinds of things outside the web app itself, usually with a Python script called from a cron job. You can access your app's settings and DB by creating a package and putting code like this in the __init__.py: from paste.deploy import appconfig from pylons import

Re: [SPAM] Proper procedure for creating scheduled tasks

2010-10-06 Thread Graham Higgins
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 5 Oct 2010, at 14:40, Alec Munro wrote: I generally don't do anything to close the session. Should I? If so, what? You could try "Session.remove()" as per: http://bitbucket.org/bbangert/pylons/src/tip/pylons/templates/default_project/+package