diff --git a/v25/storage/dbstorage.py b/v25/storage/dbstorage.py index cd8f756..47fcf57 100644 --- a/v25/storage/dbstorage.py +++ b/v25/storage/dbstorage.py @@ -1,5 +1,5 @@ import json -from subprocess import Popen, PIPE +from subprocess import run from sys import stderr from threading import Thread from time import time, sleep @@ -342,16 +342,14 @@ class DBStorage(PushStorage): @staticmethod def pushsubscription(subscription: dict): - p = Popen(["node", "v25pushx/push.js"], stdin=PIPE, shell=True) - p.communicate(json.dumps({ + assert run(["node", "v25pushx/push.js"], input=json.dumps({ "subscription": subscription, "notification": { "notification": { "title": "New Message (V25PUSH)" } } - }).encode()) - assert not p.wait(), "push subprocess failed" + })).returncode, "push subprocess failed" def pushpush(self, subject: Subject): session = self.Session()