Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Clémentine
commited on
Commit
•
8f7c1b2
1
Parent(s):
f9c697f
webhooks should not be async or risk being blocking timewise
Browse files
app.py
CHANGED
@@ -351,7 +351,7 @@ webhooks_server = enable_space_ci_and_return_server(ui=demo)
|
|
351 |
|
352 |
# Add webhooks
|
353 |
@webhooks_server.add_webhook
|
354 |
-
|
355 |
"""Redownloads the leaderboard dataset each time it updates"""
|
356 |
if payload.repo.type == "dataset" and payload.event.action == "update":
|
357 |
datasets.load_dataset(
|
@@ -365,7 +365,7 @@ async def update_leaderboard(payload: WebhookPayload) -> None:
|
|
365 |
|
366 |
LAST_UPDATE_QUEUE = datetime.datetime.now()
|
367 |
@webhooks_server.add_webhook
|
368 |
-
|
369 |
"""Redownloads the queue dataset each time it updates"""
|
370 |
if payload.repo.type == "dataset" and payload.event.action == "update":
|
371 |
current_time = datetime.datetime.now()
|
|
|
351 |
|
352 |
# Add webhooks
|
353 |
@webhooks_server.add_webhook
|
354 |
+
def update_leaderboard(payload: WebhookPayload) -> None:
|
355 |
"""Redownloads the leaderboard dataset each time it updates"""
|
356 |
if payload.repo.type == "dataset" and payload.event.action == "update":
|
357 |
datasets.load_dataset(
|
|
|
365 |
|
366 |
LAST_UPDATE_QUEUE = datetime.datetime.now()
|
367 |
@webhooks_server.add_webhook
|
368 |
+
def update_queue(payload: WebhookPayload) -> None:
|
369 |
"""Redownloads the queue dataset each time it updates"""
|
370 |
if payload.repo.type == "dataset" and payload.event.action == "update":
|
371 |
current_time = datetime.datetime.now()
|