Samo Penic
2018-12-23 6bb7d2af3bc3c1f032c1c0c4060577a158ff5f8d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/python3
from tsclient import *
import signal
 
#--- SIGINT and SIGTERM HANDLING ---
def signal_handler(signal,frame):
    t.stop()
    t.join()
    print("Process ended with signal " +str(signal))
    sys.exit(signal)
#--- END SIGINT and SIGTERM----
 
 
 
signal.signal(signal.SIGINT, signal_handler)
signal.signal(signal.SIGTERM, signal_handler)
 
t=ClientThread(conn_address='http://localhost:8000',update_seconds=100)
t.start()
#t.join()
#print("main")
while(True):
    sleep(1000)