Skip to content
Snippets Groups Projects
Commit 545f33f0 authored by Recolic K's avatar Recolic K
Browse files

d

parent ebbab31e
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,8 @@
import json, time
from websocket import create_connection
import signal, sys, pickle
import sys, pickle
from signal import *
# [(Snapshot_Time, [(buy_price1, amount1), ...] , [(sell_price1, amount1), ...]), ...]
# [(1620457034392, [(56000, 0.01), (55900, 1), (55700, 30), ...] , [(57000, 0.01), (57100, 1), ...] ), (1620457034394, [...]), ...]
......@@ -74,8 +75,9 @@ def dataset_maintain_thread_main():
print("ERROR: unexpected message (maybe ping message): ", message)
###### DEBUG ONLY
# if int(time.time()) % 60 == 0 and _debug_tmp != int(time.time()):
# _debug_tmp = int(time.time())
if int(time.time()) % 2000 == 0 and _debug_tmp != int(time.time()): # 2000 sec
_debug_tmp = int(time.time())
print("DEBUG: len(depth) = ", len(realtime_shortterm_dataset_depth))
# print("DEBUG: dumping realtime_shortterm_dataset_aggtrade================")
# print(realtime_shortterm_dataset_aggtrade)
# print("DEBUG: dumping realtime_shortterm_dataset_depth================")
......@@ -89,7 +91,14 @@ def sigint_handler(sig, frame):
save_realtime_dataset_on_exit()
sys.exit(0)
signal.signal(signal.SIGINT, sigint_handler)
for sig in (SIGABRT, SIGILL, SIGINT, SIGSEGV, SIGTERM):
signal(sig, sigint_handler)
load_realtime_dataset_on_start()
dataset_maintain_thread_main()
try:
dataset_maintain_thread_main()
except:
save_realtime_dataset_on_exit()
raise
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment