今天刚试用Celery。worker的模式已经正常,但是在beat 模式下,虽然看到每隔10秒就执行一次的记录,但是感觉task没有被执行。
@celery.task
def add(x, y):
str="a string to print to file"
f=open('out.txt','a')
print >>f,str
f.close()
上面是我的定义的task
在beat模式下面没看到有新的str输出到out.txt之中~
搞了很久也没搞定,哪位懂的能来帮忙看看吗?
对于定时任务,参考的是 http://www.metaltoad.com/blog/celery-periodic-tasks-installation-infinity
已google过,搞不定,有点想奔溃了。。。
@celery.task
def add(x, y):
str="a string to print to file"
f=open('out.txt','a')
print >>f,str
f.close()
上面是我的定义的task
在beat模式下面没看到有新的str输出到out.txt之中~
搞了很久也没搞定,哪位懂的能来帮忙看看吗?
对于定时任务,参考的是 http://www.metaltoad.com/blog/celery-periodic-tasks-installation-infinity
已google过,搞不定,有点想奔溃了。。。
