>
> 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 request is a valid object?
>
When you said "worker", I assumed you were using the web2py Scheduler -- is
that the case? If so, you can put something like the following in the model
or controller that does the import:
if request.global_settings.scheduler:
[do the time-consuming import]
If you're not using the Scheduler, what do you mean by "worker"?
Anthony
--