开发者

Task queue execution

开发者 https://www.devze.com 2022-12-31 09:29 出处:网络
I\'m developing a site for a customer which regularly sends email notifications, to facilitate this I have a cron job which runs at 2am to start scheduling individual tasks to send out the notications

I'm developing a site for a customer which regularly sends email notifications, to facilitate this I have a cron job which runs at 2am to start scheduling individual tasks to send out the notications. This is all fine and work perfectly with tasks being scheduled to execute immediately, but to ass开发者_JS百科ist development and testing I've written some CLI apps which use ipython and the remote_api_stub to interact with my application and datastore, when I schedule tasks on the command line like this:

task = taskqueue.Task(url='/admin/tasks/email', params={'email': email, 'type': notif.type})
task.add("email")

I get a 1 hour delay on the task execution. Why is this? and is there a way to get the task to execute immediately?


There seems to be a timezone-related bug in the SDK that causes the eta for tasks created through the remote API to be scheduled one hour after they're added. If you explicitly set the countdown to 0, the task should be scheduled to run immediately.


If you want it to execute immediately, just open the URL in a browser. Why muck around with Task queues?

0

精彩评论

暂无评论...
验证码 换一张
取 消