Skip to content

Commit

Permalink
Change raise_signal to os.kill for #948
Browse files Browse the repository at this point in the history
  • Loading branch information
reidsunderland authored and petersilva committed Mar 7, 2024
1 parent 3936099 commit 47dd8dc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions sarracenia/moth/amqp.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
from sarracenia.postformat import PostFormat
from sarracenia.moth import Moth
import signal
import os

import time
from urllib.parse import unquote
Expand Down Expand Up @@ -406,7 +407,7 @@ def getSetup(self) -> None:
signal.signal(signal.SIGINT, original_sigint)
signal.signal(signal.SIGTERM, original_sigterm)
if self.please_stop:
signal.raise_signal(signal.SIGINT)
os.kill(os.getpid(), signal.SIGINT)

def putSetup(self) -> None:

Expand Down Expand Up @@ -480,7 +481,7 @@ def putSetup(self) -> None:
signal.signal(signal.SIGINT, original_sigint)
signal.signal(signal.SIGTERM, original_sigterm)
if self.please_stop:
signal.raise_signal(signal.SIGINT)
os.kill(os.getpid(), signal.SIGINT)


def putCleanUp(self) -> None:
Expand Down
5 changes: 3 additions & 2 deletions sarracenia/moth/mqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
from sarracenia.postformat import PostFormat
from sarracenia.moth import Moth
import signal
import os
import ssl
import threading
import time
Expand Down Expand Up @@ -417,7 +418,7 @@ def getSetup(self):
signal.signal(signal.SIGINT, original_sigint)
signal.signal(signal.SIGTERM, original_sigterm)
if self.please_stop:
signal.raise_signal(signal.SIGINT)
os.kill(os.getpid(), signal.SIGINT)



Expand Down Expand Up @@ -498,7 +499,7 @@ def putSetup(self):
signal.signal(signal.SIGINT, original_sigint)
signal.signal(signal.SIGTERM, original_sigterm)
if self.please_stop:
signal.raise_signal(signal.SIGINT)
os.kill(os.getpid(), signal.SIGINT)


def __sub_on_message(client, userdata, msg):
Expand Down

0 comments on commit 47dd8dc

Please sign in to comment.