Browse Source

Run db thread as daemon

so that all sub-thread will inherite this and be killed automatically if main thread crash
dev
noisyfox 8 years ago
parent
commit
8777152ec9
  1. 1
      server.py

1
server.py

@ -32,6 +32,7 @@ from configloader import load_config, get_config
class MainThread(threading.Thread): class MainThread(threading.Thread):
def __init__(self, obj): def __init__(self, obj):
threading.Thread.__init__(self) threading.Thread.__init__(self)
self.daemon = True
self.obj = obj self.obj = obj
def run(self): def run(self):

Loading…
Cancel
Save