Disks Service
This commit is contained in:
parent
271007044a
commit
7f5b5209a1
10 changed files with 256 additions and 0 deletions
19
backend/disks/disks.py
Normal file
19
backend/disks/disks.py
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import http.server
|
||||
import signal
|
||||
|
||||
import request_handler
|
||||
|
||||
def shutdown(_signum, _frame):
|
||||
raise SystemExit(0)
|
||||
|
||||
SERVER_ADDRESS = ('', 50005)
|
||||
SERVER = http.server.ThreadingHTTPServer(SERVER_ADDRESS, request_handler.RequestHandler)
|
||||
SERVER.daemon_threads = False
|
||||
|
||||
signal.signal(signal.SIGINT, shutdown)
|
||||
signal.signal(signal.SIGTERM, shutdown)
|
||||
|
||||
try:
|
||||
SERVER.serve_forever()
|
||||
finally:
|
||||
SERVER.server_close()
|
||||
Loading…
Add table
Add a link
Reference in a new issue