the nicest feature! TY Anthony, I didn't know about request.global_settings!

PS: could we add that on the wiki at the 
http://web2py.com/books/default/chapter/29/4#request section so we don't 
forget about it ?

On Friday, August 3, 2012 10:16:36 PM UTC+2, Anthony wrote:
>
> I think when you run web2py with the -K option, 
> request.global_settings.scheduler exists and is set to the name/names of 
> the apps passed after the -K option (otherwise, it should be None).
>
> Anthony
>
> On Friday, August 3, 2012 12:50:33 PM UTC-4, Vincenzo Ampolo wrote:
>>
>> 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 are 
>> imported? 
>>
>> Thank you. 
>> -- 
>> Vincenzo Ampolo 
>> http://vincenzo-ampolo.net 
>> http://goshawknest.wordpress.com 
>>
>

-- 



Reply via email to