[bugfix] Beat start failed, rm pidfile

pull/828/merge
ibuler 2017-12-28 14:34:17 +08:00
parent f992347fc5
commit b6b0d6a9be
1 changed files with 2 additions and 0 deletions

View File

@ -80,6 +80,8 @@ def start_beat():
os.environ.setdefault('PYTHONOPTIMIZE', '1')
os.environ.setdefault('C_FORCE_ROOT', '1')
pidfile = '/tmp/beat.pid '
if os.path.exists(pidfile):
os.unlink(pidfile)
scheduler = "django_celery_beat.schedulers:DatabaseScheduler"
options = "--pidfile {} -l {} --scheduler {} --max-interval 60".format(
pidfile, LOG_LEVEL, scheduler,