Under Scheduler request.is_scheduler is None rather than True - Why?

38 views
Skip to first unread message

Brian M

unread,
Oct 2, 2016, 11:45:21 PM10/2/16
to web2py-users
Is there a reason why when something is run under the scheduler request.is_scheduler = None rather than True? When you access request.is_scheduler from outside of the scheduler you get False as one would expect. The current None value seems strange/non-intuitive.
#this won't work
if request.is_scheduler:
   
#do special scheduler stuff

#To really know if you're running under the scheduler you must use this which makes no sense
if request.is_scheduler == None:
   #do special scheduler stuff
 


This has been the case for a while and is still happening with the latest git trunk



Niphlod

unread,
Oct 3, 2016, 5:46:26 AM10/3/16
to web2py-users
can you please file a bug on https://github.com/web2py/web2py/issues ? I'd like to keep track of it and fix ASAP

Brian M

unread,
Oct 3, 2016, 9:27:22 AM10/3/16
to web2py-users

Anthony

unread,
Oct 3, 2016, 12:01:03 PM10/3/16
to web...@googlegroups.com
We partially fixed the problem last year, but I guess no one tested it. I have proposed a very simple fix in the newly created issue (seems to work after a quick test on Windows).

Anthony

Brian M

unread,
Oct 9, 2016, 8:25:20 PM10/9/16
to web2py-users
Thanks Anthony! request.is_scheduler == True now works under Windows for me too.
Reply all
Reply to author
Forward
0 new messages