mirror of
https://github.com/valitydev/redash.git
synced 2024-11-06 09:05:17 +00:00
Adjust RQ job priorities (#4301)
* prioritize periodic jobs * declare default queues in inside worker() * separate send_email to its own queue
This commit is contained in:
parent
cce6546a62
commit
6f791a092b
@ -47,7 +47,6 @@ services:
|
||||
REDASH_LOG_LEVEL: "INFO"
|
||||
REDASH_REDIS_URL: "redis://redis:6379/0"
|
||||
REDASH_DATABASE_URL: "postgresql://postgres@postgres/postgres"
|
||||
QUEUES: "default periodic schemas"
|
||||
celery-worker:
|
||||
build: .
|
||||
command: dev_celery_worker
|
||||
|
@ -22,14 +22,15 @@ def scheduler():
|
||||
|
||||
@manager.command()
|
||||
@argument('queues', nargs=-1)
|
||||
def worker(queues='default'):
|
||||
def worker(queues):
|
||||
# Configure any SQLAlchemy mappers loaded until now so that the mapping configuration
|
||||
# will already be available to the forked work horses and they won't need
|
||||
# to spend valuable time re-doing that on every fork.
|
||||
configure_mappers()
|
||||
|
||||
if not queues:
|
||||
queues = ('default',)
|
||||
queues = ['periodic', 'emails', 'default', 'schemas']
|
||||
|
||||
with Connection(rq_redis_connection):
|
||||
w = Worker(queues)
|
||||
w.work()
|
||||
|
@ -45,7 +45,7 @@ def subscribe(form):
|
||||
requests.post('https://beacon.redash.io/subscribe', json=data)
|
||||
|
||||
|
||||
@job('default')
|
||||
@job('emails')
|
||||
def send_mail(to, subject, html, text):
|
||||
try:
|
||||
message = Message(recipients=to,
|
||||
|
Loading…
Reference in New Issue
Block a user