Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions MC/bin/o2_dpg_workflow_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,10 @@ def setup_logger(name, log_file, level=logging.INFO):
# TODO: integrate into standard logger
def send_webhook(hook, t):
if hook!=None:
command="curl -X POST -H 'Content-type: application/json' --data '{\"text\":\" " + str(t) + "\"}' " + str(hook) + " &> /dev/null"
os.system(command)
import json
data = json.dumps({"text": " " + str(t)})
subprocess.run(["curl", "-X", "POST", "-H", "Content-type: application/json", "--data", data, str(hook)],
stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)

# A fallback solution to getting all child procs
# in case psutil has problems (PermissionError).
Expand Down