Skip to content

Commit fbaa9cf

Browse files
committed
this may have been important?
1 parent bec4602 commit fbaa9cf

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

clabot/github.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import asyncio
2+
3+
from django.conf import settings
14
from django.http import HttpRequest, JsonResponse
25
from django_github_app._typing import override
36
from django_github_app.github import AsyncGitHubAPI as BaseAsyncGitHubAPI
@@ -8,7 +11,7 @@
811
class AsyncGitHubAPI(BaseAsyncGitHubAPI):
912
@override
1013
async def sleep(self, seconds: float):
11-
return None
14+
await asyncio.sleep(settings.GITHUB_API_SLEEP)
1215

1316

1417
class AsyncWebhookView(BaseAsyncWebhookView):

clabot/settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@
162162
"WEBHOOK_SECRET": env.str("GITHUB_WEBHOOK_SECRET", default=None),
163163
"WEBHOOK_TYPE": "async",
164164
}
165+
GITHUB_API_SLEEP = env.float("GITHUB_API_SLEEP", 1.0)
165166

166167
# GitHub oauth
167168
GITHUB_OAUTH_APPLICATION_ID = env.str("GITHUB_OAUTH_APPLICATION_ID", default=None)

0 commit comments

Comments
 (0)