Fix a signal bug on python post 3.8 version
The signal can only be used on the main thread and not the flask sub process one. Signed-off-by: Reed Wade <reedwade@misterbanal.net>
This commit is contained in:
parent
152205c886
commit
3b957a1b96
6
app.py
6
app.py
|
@ -1,12 +1,16 @@
|
|||
#!/usr/bin/env python3
|
||||
from fosspay.app import app
|
||||
from fosspay.config import _cfg, _cfgi
|
||||
from fosspay.config import _cfg, _cfgi, load_config
|
||||
|
||||
import os
|
||||
|
||||
app.static_folder = os.path.join(os.getcwd(), "static")
|
||||
|
||||
import os
|
||||
import signal
|
||||
|
||||
signal.signal(signal.SIGHUP, lambda *args: load_config())
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run(host=_cfg("debug-host"), port=_cfgi('debug-port'), debug=True)
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import logging
|
||||
import signal
|
||||
|
||||
try:
|
||||
from configparser import ConfigParser
|
||||
|
@ -27,7 +26,6 @@ def load_config():
|
|||
global config
|
||||
config = ConfigParser()
|
||||
config.readfp(open('config.ini'))
|
||||
signal.signal(signal.SIGHUP, lambda *args: load_config())
|
||||
|
||||
load_config()
|
||||
|
||||
|
|
Loading…
Reference in New Issue