diff --git a/files/routes/comments.py b/files/routes/comments.py index fca2cc015..594938763 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -626,7 +626,8 @@ def api_comment(v): g.db.add(n) if parent.author.id != v.id and PUSHER_ID != 'blahblahblah': - gevent.spawn(pusher_thread, f'{request.host}{parent.author.id}', c) + try: gevent.spawn(pusher_thread, f'{request.host}{parent.author.id}', c) + except: pass diff --git a/files/routes/users.py b/files/routes/users.py index 6f913576c..281a28781 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -633,13 +633,14 @@ def message2(v, username): notif = Notification(comment_id=c.id, user_id=user.id) g.db.add(notif) + g.db.commit() + if PUSHER_ID != 'blahblahblah': if len(message) > 500: notifbody = message[:500] + '...' else: notifbody = message - gevent.spawn(pusher_thread2, f'{request.host}{user.id}', notifbody, v.username) - - g.db.commit() + try: gevent.spawn(pusher_thread2, f'{request.host}{user.id}', notifbody, v.username) + except: pass return {"message": "Message sent!"}