瀏覽代碼

celerybeat django management command

Ask Solem 15 年之前
父節點
當前提交
276a9d19ee
共有 1 個文件被更改,包括 17 次插入0 次删除
  1. 17 0
      celery/management/commands/celerybeat.py

+ 17 - 0
celery/management/commands/celerybeat.py

@@ -0,0 +1,17 @@
+"""
+
+Start the celery clock service from the Django management command.
+
+"""
+from django.core.management.base import BaseCommand
+from celery.bin.celerybeat import run_clockservice, OPTION_LIST
+
+
+class Command(BaseCommand):
+    """Run the celery daemon."""
+    option_list = BaseCommand.option_list + OPTION_LIST
+    help = 'Run the celery daemon'
+
+    def handle(self, *args, **options):
+        """Handle the management command."""
+        run_clockservice(**options)