scheduler_run table remains empty

34 views
Skip to first unread message

Christophe Meessen

unread,
May 4, 2015, 11:56:36 AM5/4/15
to web...@googlegroups.com
I'm using queue_task to execute a task once at a predefined time. The task itself calls queue_task when it finished executing itself to submit it self for a later execution at a predefined time. I'm currently testing it so I call web2p directly with the shell to check output.

This all works as expected and an entry is created in the scheduler_task table. When the task completes its status becomes COMPLETE and a new task is queued and executed at the predefined time (approximately).

My problem is that the table scheduler_run remains empty. So I can't see the output of the task. It was filled during initial development tests.

Is there a way to see logs of worker processes ? I couldn't find any. The logs directory of web2py is empty.


Niphlod

unread,
May 4, 2015, 2:59:11 PM5/4/15
to web...@googlegroups.com
is your task returning something ? if it's not returning anything, by default the corresponding scheduler_run record is deleted.

Dave S

unread,
May 4, 2015, 8:49:15 PM5/4/15
to web...@googlegroups.com


On Monday, May 4, 2015 at 8:56:36 AM UTC-7, Christophe Meessen wrote:
 
Is there a way to see logs of worker processes ? I couldn't find any. The logs directory of web2py is empty.


I think you have to make your tasks do logging.  Here's an example of how someone set it up:
<URL:https://groups.google.com/d/msg/web2py/91UugH6T3dQ/6xkgen92SesJ>

I thought there was a more recent example, but I only find logging being mentioned.

/dps

Dave S

unread,
May 4, 2015, 8:51:03 PM5/4/15
to web...@googlegroups.com

Ah, this may be what I was remembering:
<URL:https://groups.google.com/d/msg/web2py/91UugH6T3dQ/6xkgen92SesJ>

/dps

Dave S

unread,
May 4, 2015, 9:41:00 PM5/4/15
to web...@googlegroups.com


I think the second link mentions logging.conf.  In there, you should have

[loggers]
keys
=root,rocket,markdown,web2py,rewrite,cron,app,welcome,myApp


(Add myApp to the existing list of keys)

and
# myApp app handler
[logger_LogServer]
level
=DEBUG
qualname
=web2py.app.myApp
handlers
=consoleHandler,rotatingFileHandler
propagate
=0


I think those are default handlers, but check under the [handlers] section that they aren't commented out.

Note that the welcome app example in logging.conf uses "level=WARNING".
This filters out anything less urgent than a WARNING.  myApp has this level opened up to DEBUG.

It appears logging.conf is only read at startup, so when you make changes, bounce the web2py instance.

The output goes into logs/web2py.log unless you set things up differently, and you should see (among web2py's own entries) something like

2015-05-04 18:26:12,028 - web2py.app.myApp - DEBUG - BEGIN: top of myController

/dps "now if I can just remember where I posted this next time I need it"



Christophe Meessen

unread,
May 6, 2015, 9:28:49 AM5/6/15
to web...@googlegroups.com
Thank you very much.

My question was not clearly formulated. The task I run for my tests is very quick (appending a time stamp to a file) so I couldn't see the record in the scheduler_run table during this short period because the record is deleted when the task terminates.

I was looking for a solution to avoid the deletion of the record in the scheduler_run table. I knew it was possible because in my initial experimenting with scheduling this is what happened.

After further research I finally found out that to preserve the record in the scheduler_run table, the task must return a result. It is then possible to view the result, the output of the task, at what time it was executed, etc.
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages