We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4ccbd27 commit 0361296Copy full SHA for 0361296
replit_river/rate_limiter.py
@@ -1,5 +1,6 @@
1
import asyncio
2
import random
3
+from contextvars import Context
4
from typing import Dict
5
6
from replit_river.transport_options import ConnectionRetryOptions
@@ -83,7 +84,9 @@ def start_restoring_budget(self, user: str) -> None:
83
84
Args:
85
user (str): The identifier for the user.
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
+ )
90
91
async def restore_budget(self, user: str) -> None:
92
"""Asynchronously wait for the interval and then restore the budget for the
0 commit comments