On 3 Aug 2012, at 5:23 PM, Vincenzo Ampolo <[email protected]> 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 request is a valid object?
> 
> Thanks Niphlod for your help but the workaround of letting staff like
> it's now is not feasible or i should wait 2 mins for each shell i open.
> The external scheduler can be a solution though. But I want to try this
> request method first...

At least for cron jobs, web2py constructs a fake request object. Have a look at 
request.env for some distinguishing characteristics. Maybe request should have 
a documented standard way of determining the source of the invocation.

-- 



Reply via email to