mirror of
https://github.com/kurbezz/discord-bot.git
synced 2025-12-06 15:15:37 +01:00
Add taskiq
This commit is contained in:
20
src/core/broker.py
Normal file
20
src/core/broker.py
Normal file
@@ -0,0 +1,20 @@
|
||||
from taskiq import TaskiqScheduler
|
||||
from taskiq.schedule_sources import LabelScheduleSource
|
||||
from taskiq_redis import ListQueueBroker, RedisAsyncResultBackend
|
||||
|
||||
from core.config import config
|
||||
|
||||
|
||||
broker = ListQueueBroker(
|
||||
url=config.REDIS_URI,
|
||||
result_backend=RedisAsyncResultBackend(
|
||||
redis_url=config.REDIS_URI,
|
||||
result_ex_time=60 * 60 * 24 * 7,
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
scheduler = TaskiqScheduler(
|
||||
broker=broker,
|
||||
sources=[LabelScheduleSource(broker)],
|
||||
)
|
||||
Reference in New Issue
Block a user