mirror of
https://github.com/retspen/webvirtcloud
synced 2026-11-11 12:46:49 +00:00
feat(operations): the job worker
This commit is contained in:
parent
34582d23f3
commit
a35284bbc9
10 changed files with 791 additions and 50 deletions
0
operations/management/__init__.py
Normal file
0
operations/management/__init__.py
Normal file
0
operations/management/commands/__init__.py
Normal file
0
operations/management/commands/__init__.py
Normal file
11
operations/management/commands/run_worker.py
Normal file
11
operations/management/commands/run_worker.py
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
from django.core.management.base import BaseCommand, CommandError
|
||||
|
||||
from operations.worker import Worker
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
help = "Run the job worker (one per installation)."
|
||||
|
||||
def handle(self, *args, **options):
|
||||
if Worker().run() != 0:
|
||||
raise CommandError("Another worker runs on this host")
|
||||
Loading…
Add table
Add a link
Reference in a new issue