File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed
docs/framework_integrations Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ bot = Bot(token="TOKEN")
67
67
@dp.startup ()
68
68
async def setup_taskiq (bot : Bot, * _args , ** _kwargs ):
69
69
# Here we check if it's a clien-side,
70
- # Becuase otherwise you're going to
70
+ # Because otherwise you're going to
71
71
# create infinite loop of startup events.
72
72
if not broker.is_worker_process:
73
73
logging.info(" Setting up taskiq" )
Original file line number Diff line number Diff line change @@ -144,9 +144,6 @@ async def run_scheduler_loop(scheduler: TaskiqScheduler) -> None:
144
144
running_schedules = set ()
145
145
while True :
146
146
# We use this method to correctly sleep for one minute.
147
- next_minute = datetime .now ().replace (second = 0 , microsecond = 0 ) + timedelta (
148
- minutes = 1 ,
149
- )
150
147
scheduled_tasks = await get_all_schedules (scheduler )
151
148
for source , task_list in scheduled_tasks .items ():
152
149
for task in task_list :
@@ -165,7 +162,9 @@ async def run_scheduler_loop(scheduler: TaskiqScheduler) -> None:
165
162
)
166
163
running_schedules .add (send_task )
167
164
send_task .add_done_callback (running_schedules .discard )
168
-
165
+ next_minute = datetime .now ().replace (second = 0 , microsecond = 0 ) + timedelta (
166
+ minutes = 1 ,
167
+ )
169
168
delay = next_minute - datetime .now ()
170
169
await asyncio .sleep (delay .total_seconds ())
171
170
You can’t perform that action at this time.
0 commit comments