Skip to content

Commit b83f92e

Browse files
committed
Moving to Process off async
1 parent 5b386ce commit b83f92e

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/app.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
load_dotenv()
55

66
from release import processRelease
7+
from multiprocessing import Process
78

89
import os
910
import hashlib
1011
import hmac
11-
import asyncio
1212

1313

1414
token = os.environ.get("API_TOKEN")
@@ -27,7 +27,8 @@ async def webhooks(repo):
2727

2828
if payload['repository']['name'] == repo and 'action' in payload.keys():
2929
if payload['action'] == 'released' and 'release' in payload.keys():
30-
asyncio.create_task(processRelease(repo, payload))
30+
p = Process(target=processRelease, args=(repo,payload))
31+
p.start()
3132

3233
return 'Thanks!', 202
3334

src/release.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from pathlib import Path
77

88

9-
async def processRelease(repo, payload):
9+
def processRelease(repo, payload):
1010
base_path = Path(__file__).parent
1111
file_name = repo + '.json'
1212
file_path = (base_path / '..' / 'sites' / file_name).resolve()

0 commit comments

Comments
 (0)