Commit ·
afb53f4
1
Parent(s): d1ef64f
fix: use get_running_loop instead of deprecated get_event_loop
Browse files
api.py
CHANGED
|
@@ -100,7 +100,7 @@ async def scan(req: ScanRequest):
|
|
| 100 |
owner, repo, file_path = parse_github_url(req.url)
|
| 101 |
if not owner or not repo or not file_path:
|
| 102 |
return {"error": "Invalid GitHub file URL. Must contain /blob/."}
|
| 103 |
-
loop = asyncio.
|
| 104 |
with concurrent.futures.ThreadPoolExecutor() as pool:
|
| 105 |
result = await loop.run_in_executor(pool, run_scan, owner, repo, file_path)
|
| 106 |
return result
|
|
|
|
| 100 |
owner, repo, file_path = parse_github_url(req.url)
|
| 101 |
if not owner or not repo or not file_path:
|
| 102 |
return {"error": "Invalid GitHub file URL. Must contain /blob/."}
|
| 103 |
+
loop = asyncio.get_running_loop()
|
| 104 |
with concurrent.futures.ThreadPoolExecutor() as pool:
|
| 105 |
result = await loop.run_in_executor(pool, run_scan, owner, repo, file_path)
|
| 106 |
return result
|