I must be missing something really obvious, or something really strange is
going on.
I've just made a very simple test:
- one only application
- one only db
- migrations enabled
In models/scheduler.py:
def mytest():
print 'this is my test'
return True
from gluon.scheduler import Scheduler
scheduler = Scheduler(db, max_empty_runs=5)
In controllers/default.py:
@auth.requires_login()
def initialize():
scheduler.queue_task('mytest', period=30, repeats=0, timeout=5,
retry_failed=-1, application_name='webmedios')
return 'function "mytest" scheduled succesfully'
I called default/initialize to queue the task, then checked that it had
effectively been queued, then ran this:
python /myhome/medios/web2py.py -K webmedios -D 0
web2py Web Framework
Created by Massimo Di Pierro, Copyright 2007-2015
Version 2.10.3-stable+timestamp.2015.04.02.21.42.07
Database drivers available: sqlite3, psycopg2, pg8000, pymysql, imaplib
starting single-scheduler for "webmedios"...
DEBUG:pyDAL:Your database version does not support the JSON data type
(using TEXT instead)
DEBUG:web2py.scheduler.medios#9753:defining tables (migrate=True)
DEBUG:web2py.scheduler.medios#9753:thread building own DAL object
DEBUG:web2py.scheduler.medios#9753:looping...
DEBUG:pyDAL:Your database version does not support the JSON data type
(using TEXT instead)
DEBUG:web2py.scheduler.medios#9753:defining tables (migrate=False)
INFO:web2py.scheduler.medios#9753:nothing to do
DEBUG:web2py.scheduler.medios#9753:sleeping...
DEBUG:web2py.scheduler.medios#9753:empty runs 1/5
DEBUG:web2py.scheduler.medios#9753: freeing workers that have not sent
heartbeat
INFO:web2py.scheduler.medios#9753:TICKER: I'm a ticker
DEBUG:web2py.scheduler.medios#9753:looping...
DEBUG:web2py.scheduler.medios#9753:Assigning tasks...
INFO:web2py.scheduler.medios#9753:TICKER: workers are 1
INFO:web2py.scheduler.medios#9753:TICKER: tasks are 0
DEBUG:web2py.scheduler.medios#9753:Tasks assigned...
DEBUG:web2py.scheduler.medios#9753:sleeping...
DEBUG:web2py.scheduler.medios#9753:empty runs 2/5
DEBUG:web2py.scheduler.medios#9753:........recording heartbeat (ACTIVE)
DEBUG:web2py.scheduler.medios#9753:looping...
INFO:web2py.scheduler.medios#9753:nothing to do
DEBUG:web2py.scheduler.medios#9753:sleeping...
DEBUG:web2py.scheduler.medios#9753:empty runs 3/5
DEBUG:web2py.scheduler.medios#9753:........recording heartbeat (ACTIVE)
DEBUG:web2py.scheduler.medios#9753:looping...
INFO:web2py.scheduler.medios#9753:nothing to do
DEBUG:web2py.scheduler.medios#9753:sleeping...
DEBUG:web2py.scheduler.medios#9753:empty runs 4/5
DEBUG:web2py.scheduler.medios#9753:........recording heartbeat (ACTIVE)
DEBUG:web2py.scheduler.medios#9753:looping...
INFO:web2py.scheduler.medios#9753:nothing to do
DEBUG:web2py.scheduler.medios#9753:sleeping...
DEBUG:web2py.scheduler.medios#9753:empty runs 5/5
INFO:web2py.scheduler.medios#9753:empty runs limit reached, killing myself
INFO:web2py.scheduler.medios#9753:die!
This very simple test is not working :/
I don't know where else to look. I've already touched uwsgi.ini to reload
the python app. I went even further and stopped all services (nginx, uwsgi,
pgbouncer, postgres) and started them again (I don't know why I did it, but
I was tempted to try). I'm pretty lost. My one last only card is to restart
the server. I know. Awfull. And hopeless. :/
El martes, 12 de mayo de 2015, 18:58:25 (UTC-3), Niphlod escribió:
>
> 2.10.3 and 2.10.4 didn't change a single bit about the scheduler.
> Check again. There MUST be some hiccup in your deployment code.
>
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.