2016-10-17 21:11 GMT+02:00 Niphlod <niph...@gmail.com>:

> BTW: please start adapting your code to use mysched.queue_task(....)
> instead of db.scheduler_task.insert(...) .
> Next releases could change the format of the scheduler_task table and only
> the queue_task method is the supported one (i.e. will handle eventual
> corner-cases that won't be possible using db.scheduler_task.insert(....))
>


Thank you again for this hint. ​I have changed my program.
If somebody is interested (changes are marked red):

This is the old code:

      tasknr = db.scheduler_task.insert(
            status='QUEUED',
            application_name='secure',
            task_name=task_name,
            function_name='smsEmailAussenden',
            args = dumps([aussendungNr]),
            vars={},
            enabled=True,
            start_time=start_time or datetime.datetime.now(),
            stop_time=stop_time or (datetime.datetime.now()+timed
elta(days=1)),
            repeats=1,
            retry_failed=1,
            period=800,
            timeout=200,
        )

I have changed it to:

        start_time1 = start_time or datetime.datetime.now()

        scheduler.queue_task(
            smsEmailAussenden,
            application_name='secure',
            task_name=task_name,
            pargs=[aussendungNr],
            pvars={},
            enabled=True,
            start_time=start_time1,
            next_run_time=start_time1,
            stop_time=stop_time or (start_time1 + timedelta(days=1)),
            repeats=1,
            retry_failed=1,
            period=800,
            timeout=200,
        )

​

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to