mirror of
https://github.com/YunoHost/webhooks.git
synced 2024-09-03 19:56:54 +02:00
[fix] don't be blocking on sending message to xmpp
This commit is contained in:
parent
f98f2ed245
commit
c8645ab3e6
1 changed files with 4 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
|||
import os
|
||||
import hmac
|
||||
import hashlib
|
||||
import asyncio
|
||||
import subprocess
|
||||
|
||||
from sanic import Sanic
|
||||
|
@ -36,7 +37,9 @@ def notify(message, repository="dev"):
|
|||
chan = other_chans.get(repository, "dev")
|
||||
|
||||
print(f"{chan} -> {message}")
|
||||
subprocess.check_call(["python", "./to_room.py", gitbot_password, message, chan])
|
||||
proc = await asyncio.create_subprocess_shell(f"python ./to_room.py '{gitbot_password}' '{message}' '{chan}'")
|
||||
await proc.communicate()
|
||||
await proc.wait()
|
||||
|
||||
|
||||
@app.route("/github", methods=['GET'])
|
||||
|
|
Loading…
Reference in a new issue