我正在使用 uwsgi 装饰器(特别是 cron 装饰器)在特定时间做事。我有以下代码:
import cherrypy
import uwsgidecorators
class TestObject(object):
@cherrypy.expose
def index(self):
launchapp = self.launchapp(-1,-1,-1,-1,-1,"foobar")
return "This is a test"
@uwsgidecorators.cron(minute,hour,day,month,dayweek)
def launchapp(self,target):
print "the target is %s" %target
return
但是我得到了错误:
@uwsgidecorators.cron(minute,hour,day,month,dayweek)
NameError: name 'minute' is not defined
我基本上是在尝试在 index 函数中指定 cron 装饰器的计时参数。有人知道我在做什么错吗?