You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#scheduler_entrypoint.py
from taskiq import TaskiqScheduler
from taskiq.schedule_sources import LabelScheduleSource
from src.taskiq_broker.broker import broker
from src.taskiq_broker.tasks.account import ping_task, fetch_bgu_data
scheduler = TaskiqScheduler(
broker=broker,
sources=[LabelScheduleSource(broker)],
)
#worker_entrypoint.py
from src.taskiq_broker.broker import broker as broker
from src.taskiq_broker.tasks.account import ping_task, fetch_bgu_data
In my containers I run a scheduler and a worker like this
uv run taskiq worker src.taskiq_broker.worker_entrypoint:broker -w 1 uv run taskiq scheduler src.taskiq_broker.scheduler_entrypoint:scheduler --skip-first-run
The task (fetch_bgu_data) is programmed to run at 00:00 every day.
But I need to do init during the working day, which I do like this uv run python -m src.taskiq_broker.cli run task fetch_bgu_data
When i call task task from
#cli.py
import asyncio
from typing import Any
import typer
import pkgutil
import inspect
import importlib
app = typer.Typer()
run_app = typer.Typer() TASKS: dict[str, Any] = {}
for _, module_name, _ in pkgutil.iter_modules(["src/taskiq_broker/tasks"]):
module = importlib.import_module(f"src.taskiq_broker.tasks.{module_name}")
for name, obj in inspect.getmembers(module):
if hasattr(obj, "kiq") and callable(obj.kiq):
TASKS[name] = obj
@run_app.command("task")
def run_task(task_name: str, param: str | None = None):
"""Run any Taskiq task."""
async def _run():
task = TASKS.get(task_name)
if not task:
typer.echo(f"Task '{task_name}' not found.")
raise typer.Exit(1)
kwargs = {}
if param:
kwargs["param"] = param
result = await task.kiq(**kwargs)
typer.echo(f"Task queued with ID: {result.task_id}")
asyncio.run(_run())
app.add_typer(run_app, name="run")
if __name__ == "__main__":
app()
The problem is that during this task, which I run manually, OUTSIDE the scheduler, for the next 30 minutes, the same task starts, please help me figure out what the problem is.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Hello everyone! First of all, thanks for the awesome package
I have a problem, but I can't figure out if it's because of my clumsy hands or if I've stumbled upon some bug.
Struct

In my containers I run a scheduler and a worker like this
The task (fetch_bgu_data) is programmed to run at 00:00 every day.
But I need to do init during the working day, which I do like this
uv run python -m src.taskiq_broker.cli run task fetch_bgu_dataWhen i call task task from
The problem is that during this task, which I run manually, OUTSIDE the scheduler, for the next 30 minutes, the same task starts, please help me figure out what the problem is.
local logs
container logs
All reactions