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
14from django .http import HttpRequest , JsonResponse
25from django_github_app ._typing import override
36from django_github_app .github import AsyncGitHubAPI as BaseAsyncGitHubAPI
811class AsyncGitHubAPI (BaseAsyncGitHubAPI ):
912 @override
1013 async def sleep (self , seconds : float ):
11- return None
14+ await asyncio . sleep ( settings . GITHUB_API_SLEEP )
1215
1316
1417class AsyncWebhookView (BaseAsyncWebhookView ):
Original file line number Diff line number Diff line change 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
167168GITHUB_OAUTH_APPLICATION_ID = env .str ("GITHUB_OAUTH_APPLICATION_ID" , default = None )
You can’t perform that action at this time.
0 commit comments