mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-14 14:52:15 +00:00
Use split queuing for tasks
This commit is contained in:
@@ -27,3 +27,6 @@ CELERYBEAT_SCHEDULE = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CELERY_ROUTES = {
|
||||||
|
"sso.tasks.update_service_groups": {'queue': 'bulk'}},
|
||||||
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ DATABASES = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
## EVE Proxy
|
## EVE Proxy
|
||||||
EVE_API_URL = "http://apitest.eveonline.com"
|
EVE_API_URL = "https://api.eveonline.com"
|
||||||
EVE_PROXY_KEEP_LOGS = 30
|
EVE_PROXY_KEEP_LOGS = 30
|
||||||
|
|
||||||
## SSO
|
## SSO
|
||||||
|
|||||||
17
fabfile.py
vendored
17
fabfile.py
vendored
@@ -19,6 +19,8 @@ def production():
|
|||||||
env.uwsgiconfig = os.path.join(env.path, '..', 'etc', 'uwsgi', 'dreddit-auth.ini')
|
env.uwsgiconfig = os.path.join(env.path, '..', 'etc', 'uwsgi', 'dreddit-auth.ini')
|
||||||
env.password = sha1('%s-%s' % (env.user, env.vhost)).hexdigest()
|
env.password = sha1('%s-%s' % (env.user, env.vhost)).hexdigest()
|
||||||
|
|
||||||
|
env.celeryconf = '--settings=%(config)s --pidfile=logs/%%n.pid --logfile=logs/%%n.log -n auth.pleaseignore.com bulk default -c 5 -c:bulk 3 -E:default' % env
|
||||||
|
|
||||||
def test():
|
def test():
|
||||||
"Use the test enviroment on Web2"
|
"Use the test enviroment on Web2"
|
||||||
env.hosts = ['dreddit@web2.pleaseignore.com']
|
env.hosts = ['dreddit@web2.pleaseignore.com']
|
||||||
@@ -141,7 +143,7 @@ def start_celeryd():
|
|||||||
require('path')
|
require('path')
|
||||||
|
|
||||||
with cd('%(path)s/dreddit-auth/' % env):
|
with cd('%(path)s/dreddit-auth/' % env):
|
||||||
run('. env/bin/activate; app/manage.py celeryd_detach --settings=%(config)s -l INFO -B --pidfile logs/celeryd.pid -f logs/celeryd.log -n auth-processor' % env)
|
run('. env/bin/activate; app/manage.py celeryd_multi start auth %(celeryconf)s' % env)
|
||||||
|
|
||||||
|
|
||||||
def stop_celeryd():
|
def stop_celeryd():
|
||||||
@@ -150,14 +152,10 @@ def stop_celeryd():
|
|||||||
"""
|
"""
|
||||||
require('hosts')
|
require('hosts')
|
||||||
require('path')
|
require('path')
|
||||||
|
require('config')
|
||||||
|
|
||||||
with cd('%(path)s/dreddit-auth/' % env):
|
with cd('%(path)s/dreddit-auth/' % env):
|
||||||
if exists('logs/celeryd.pid'):
|
run('. env/bin/activate; app/manage.py celeryd_multi stop %(celeryconf)s' % env)
|
||||||
run('kill -15 `cat logs/celeryd.pid`')
|
|
||||||
time.sleep(2)
|
|
||||||
run('rm -f logs/celeryd.pid')
|
|
||||||
else:
|
|
||||||
warn('celeryd isn\'t running')
|
|
||||||
|
|
||||||
def kill_celeryd():
|
def kill_celeryd():
|
||||||
"""
|
"""
|
||||||
@@ -171,9 +169,8 @@ def restart_celeryd():
|
|||||||
"""
|
"""
|
||||||
Restart the celery daemon
|
Restart the celery daemon
|
||||||
"""
|
"""
|
||||||
stop_celeryd()
|
with cd('%(path)s/dreddit-auth/' % env):
|
||||||
time.sleep(2)
|
run('. env/bin/activate; app/manage.py celeryd_multi restart %(celeryconf)s' % env)
|
||||||
start_celeryd()
|
|
||||||
|
|
||||||
|
|
||||||
def start_uwsgi():
|
def start_uwsgi():
|
||||||
|
|||||||
Reference in New Issue
Block a user