Skip to content

Commit

Permalink
Increase timeout limits, we lose some requests which waits for too ma…
Browse files Browse the repository at this point in the history
…ny requests to pass. (#22)

Co-authored-by: Ömer Faruk Özdemir <[email protected]>
  • Loading branch information
omerXfaruq and Ömer Faruk Özdemir authored Aug 21, 2022
1 parent 3649bc6 commit 86691ce
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ async def main_event(cls) -> None:
while True:
await asyncio.sleep(cls.get_time_until_next_hour())
async with AsyncClient() as client:
print(cls.HOST_URL)
endpoint = f"http://0.0.0.0:{cls.PORT}/trigger_send_user_hourly_memories/{Events.TOKEN}"
response = await client.post(url=endpoint)

Expand Down Expand Up @@ -135,7 +134,7 @@ async def broadcast_message(cls, message: str) -> None:

@classmethod
async def request(cls, url: str, payload: dict, debug: bool = True) -> Response:
async with AsyncClient() as client:
async with AsyncClient(timeout=30 * 60) as client:
request = await client.post(url, json=payload)
if debug:
print(request.json())
Expand Down

0 comments on commit 86691ce

Please sign in to comment.