Skip to content

Commit 0361296

Browse files
committed
use empty context in restore budget task
1 parent 4ccbd27 commit 0361296

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

replit_river/rate_limiter.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import asyncio
22
import random
3+
from contextvars import Context
34
from typing import Dict
45

56
from replit_river.transport_options import ConnectionRetryOptions
@@ -83,7 +84,9 @@ def start_restoring_budget(self, user: str) -> None:
8384
Args:
8485
user (str): The identifier for the user.
8586
"""
86-
self.tasks[user] = asyncio.create_task(self.restore_budget(user))
87+
self.tasks[user] = asyncio.create_task(
88+
self.restore_budget(user), context=Context()
89+
)
8790

8891
async def restore_budget(self, user: str) -> None:
8992
"""Asynchronously wait for the interval and then restore the budget for the

0 commit comments

Comments
 (0)