Re: [web2py] run code only if you are a worker

2012-08-03 Thread Jonathan Lundell
On 3 Aug 2012, at 5:23 PM, Vincenzo Ampolo wrote: > > On 08/03/2012 02:53 PM, Anthony wrote: >> There's also request.global_settings.cronjob. > > Cool but where do I've request available? It's not at import time but > i've a request object in web2py.py -M -S milo > > So when can i know that req

[web2py] run code only if you are a worker

2012-08-03 Thread Vincenzo Ampolo
Hi, I've an import that takes too much time and resources. Basically it sets up a NLTK tagger. I need this feature imported only if I'm runing as a worker. If I'm running the webserver or the shell I don't need that import at all. Is there a way to detect if I'm a worker when the models/modules