Hello,
I've noticed that the cleanup task in scheduler.py is not working for
me. Looking into it, it appears that the handling of time intervals in
MySQL through DAL is not being done properly.

This code
db(db.task_scheduled.status.belongs(statuses)) \
(db.task_scheduled.last_run_time+60<now)._select()

generates the following sql

SELECT  task_scheduled.id, task_scheduled.name,
task_scheduled.group_name, task_scheduled.status, task_scheduled.func,
task_scheduled.args, task_scheduled.vars, task_scheduled.enabled,
task_scheduled.start_time, task_scheduled.next_run_time,
task_scheduled.stop_time, task_scheduled.repeats,
task_scheduled.period, task_scheduled.timeout,
task_scheduled.times_run, task_scheduled.last_run_time,
task_scheduled.assigned_worker_name FROM task_scheduled WHERE
((task_scheduled.status IN ('completed')) AND
((task_scheduled.last_run_time + '60') < '2011-08-23 15:01:38'));

However, if I execute the following in MySQL:

SELECT last_run_time + '60' < '2011-08-23 15:01:38' FROM
task_scheduled ORDER BY ID DESC LIMIT 1;

I get all zeros and MySQL even provides a warning about incorrect
DOUBLE value '2011-08-23 15:01:38'

If you do
SELECT '2011-08-23 15:01:38' + 60;
you also get this warning and the result is meaningless 2071.

Is this an error in the MySQL adapter for DAL or is the query missing
something to explicitly tell MySQL to do time interval arithmatic?

Thanks,
G

Reply via email to