Skip to content

Instantly share code, notes, and snippets.

@KristianOellegaard
Created December 6, 2013 14:17
Show Gist options
  • Save KristianOellegaard/7824854 to your computer and use it in GitHub Desktop.
Save KristianOellegaard/7824854 to your computer and use it in GitHub Desktop.
import os
from django.core.management import BaseCommand
from circus import get_arbiter
class Command(BaseCommand):
def handle(self, *args, **kwargs):
arbiter = get_arbiter([
{
"cmd": "python manage.py rqworker",
'env': os.environ,
"numprocesses": 3,
'stdout_stream': {
'class': 'StdoutStream'
},
'stderr_stream': {
'class': 'StdoutStream'
}
}
])
try:
arbiter.start()
finally:
arbiter.stop()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment