Fix task priorities

This commit is contained in:
Gui Heise 2022-02-16 10:41:48 -05:00
parent b86ecbca87
commit c58d75118d

View File

@ -11,7 +11,9 @@ from mev_inspect.queue.middleware import (
InspectorMiddleware, InspectorMiddleware,
) )
from mev_inspect.queue.tasks import ( from mev_inspect.queue.tasks import (
HIGH_PRIORITY,
HIGH_PRIORITY_QUEUE, HIGH_PRIORITY_QUEUE,
LOW_PRIORITY,
LOW_PRIORITY_QUEUE, LOW_PRIORITY_QUEUE,
export_block_task, export_block_task,
inspect_many_blocks_task, inspect_many_blocks_task,
@ -25,5 +27,9 @@ broker.add_middleware(AsyncMiddleware())
broker.add_middleware(InspectorMiddleware(os.environ["RPC_URL"])) broker.add_middleware(InspectorMiddleware(os.environ["RPC_URL"]))
dramatiq.set_broker(broker) dramatiq.set_broker(broker)
dramatiq.actor(inspect_many_blocks_task, queue_name=HIGH_PRIORITY_QUEUE) dramatiq.actor(
dramatiq.actor(export_block_task, queue_name=LOW_PRIORITY_QUEUE) inspect_many_blocks_task, queue_name=LOW_PRIORITY_QUEUE, priority=LOW_PRIORITY
)
dramatiq.actor(
export_block_task, queue_name=HIGH_PRIORITY_QUEUE, priority=HIGH_PRIORITY
)