migrationt to websocket
All checks were successful
SonarQube Scan / SonarQube Trigger (push) Successful in 1m15s

This commit is contained in:
dongho
2024-12-22 00:57:07 +09:00
parent 2d31dcfd0b
commit 82216daaf8
5 changed files with 808 additions and 155 deletions

View File

@ -98,6 +98,14 @@ def handle_message(message):
time = message["t"]
msg = message["d"]["k"]
msg["stime"] = time
msg["c"] = float(msg["c"])
msg["h"] = float(msg["h"])
msg["l"] = float(msg["l"])
msg["o"] = float(msg["o"])
msg["v"] = float(msg["v"])
msg["T"] = int(msg["T"])
msg["a"] = float(msg["a"])
msg["t"] = int(msg["t"])
msg["time"] = datetime.now(timezone).strftime("%Y/%m/%d, %H:%M:%S")
mdb.insert_coin_price(col.lower(), msg)