add /logs/*

This commit is contained in:
2025-11-01 11:59:09 +03:00
parent 6ffb7df0f7
commit c03443dd78
2 changed files with 7 additions and 6 deletions

3
.gitignore vendored
View File

@@ -1,2 +1,3 @@
/__pycache__ /__pycache__
/TestJson /TestJson
/logs/*

View File

@@ -135,7 +135,7 @@ def start_offline_threads(season, game_id):
t.start() t.start()
CURRENT_THREADS_MODE = "offline" CURRENT_THREADS_MODE = "offline"
print("[threads] OFFLINE threads started") logger.info("[threads] OFFLINE threads started")
def start_live_threads(season, game_id): def start_live_threads(season, game_id):
@@ -232,7 +232,7 @@ def start_live_threads(season, game_id):
t.start() t.start()
CURRENT_THREADS_MODE = "live" CURRENT_THREADS_MODE = "live"
print("[threads] LIVE threads started") logger.info("[threads] LIVE threads started")
def stop_live_threads(): def stop_live_threads():
@@ -244,7 +244,7 @@ def stop_live_threads():
for t in threads_live: for t in threads_live:
t.join(timeout=1) t.join(timeout=1)
threads_live = [] threads_live = []
print("[threads] LIVE threads stopped") logger.info("[threads] LIVE threads stopped")
def stop_offline_threads(): def stop_offline_threads():
@@ -256,7 +256,7 @@ def stop_offline_threads():
for t in threads_offline: for t in threads_offline:
t.join(timeout=1) t.join(timeout=1)
threads_offline = [] threads_offline = []
print("[threads] OFFLINE threads stopped") logger.info("[threads] OFFLINE threads stopped")
# общая очередь # общая очередь
@@ -295,7 +295,7 @@ def get_data_from_API(
value = {"error": str(ex)} value = {"error": str(ex)}
ts = datetime.now().strftime("%Y-%m-%d %H:%M:%S.%f")[:-3] ts = datetime.now().strftime("%Y-%m-%d %H:%M:%S.%f")[:-3]
results_q.put({"source": name, "ts": ts, "data": value}) results_q.put({"source": name, "ts": ts, "data": value})
print(f"[{ts}] name: {name}, status: {value.get('status', 'no-status')}") logger.debug(f"[{ts}] name: {name}, status: {value.get('status', 'no-status')}")
# сколько уже заняло # сколько уже заняло
elapsed = time.time() - start elapsed = time.time() - start