File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change
1
+ import asyncio
2
+
3
+ from django .conf import settings
1
4
from django .http import HttpRequest , JsonResponse
2
5
from django_github_app ._typing import override
3
6
from django_github_app .github import AsyncGitHubAPI as BaseAsyncGitHubAPI
8
11
class AsyncGitHubAPI (BaseAsyncGitHubAPI ):
9
12
@override
10
13
async def sleep (self , seconds : float ):
11
- return None
14
+ await asyncio . sleep ( settings . GITHUB_API_SLEEP )
12
15
13
16
14
17
class AsyncWebhookView (BaseAsyncWebhookView ):
Original file line number Diff line number Diff line change 162
162
"WEBHOOK_SECRET" : env .str ("GITHUB_WEBHOOK_SECRET" , default = None ),
163
163
"WEBHOOK_TYPE" : "async" ,
164
164
}
165
+ GITHUB_API_SLEEP = env .float ("GITHUB_API_SLEEP" , 1.0 )
165
166
166
167
# GitHub oauth
167
168
GITHUB_OAUTH_APPLICATION_ID = env .str ("GITHUB_OAUTH_APPLICATION_ID" , default = None )
You can’t perform that action at this time.
0 commit comments