Switch to multiprocessing
This commit is contained in:
parent
4e576599bd
commit
eb535a4b84
|
@ -1,8 +1,8 @@
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from character_display import CharacterDisplay
|
from character_display import CharacterDisplay
|
||||||
from threading import Event
|
from multiprocessing import Event
|
||||||
from threading import Thread
|
from multiprocessing import Process
|
||||||
from signal import signal
|
from signal import signal
|
||||||
from signal import SIGTERM
|
from signal import SIGTERM
|
||||||
from time import sleep
|
from time import sleep
|
||||||
|
@ -28,7 +28,7 @@ def main():
|
||||||
signal(SIGTERM, cleanExit(unicorn, haltEvent))
|
signal(SIGTERM, cleanExit(unicorn, haltEvent))
|
||||||
unicorn.brightness(0.3)
|
unicorn.brightness(0.3)
|
||||||
|
|
||||||
weatherThread = Thread(target=weatherLoop, args=[haltEvent])
|
weatherThread = Process(target=weatherLoop, args=[haltEvent])
|
||||||
weatherThread.start()
|
weatherThread.start()
|
||||||
|
|
||||||
characterDisplay = CharacterDisplay(unicorn)
|
characterDisplay = CharacterDisplay(unicorn)
|
||||||
|
|
|
@ -4,6 +4,7 @@ After=multi.user.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
|
KillMode=mixed
|
||||||
WorkingDirectory=$workingDirectory
|
WorkingDirectory=$workingDirectory
|
||||||
ExecStart=$execStart
|
ExecStart=$execStart
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
|
|
Loading…
Reference in New Issue