feat: Добавлена синхронизация клиентских токенов при рестарте бэкенда

This commit is contained in:
AURUMVORXX
2025-10-28 00:47:37 +05:00
parent d45aafa407
commit aa6b5700ce
2 changed files with 5 additions and 0 deletions

View File

@@ -55,6 +55,8 @@ class PyG2O
{ {
if (!_silent) if (!_silent)
print("[PyG2O] Successfully connected to " + url); print("[PyG2O] Successfully connected to " + url);
_send({"init_temp_tokens": _clientTokens});
} }
function _onClose(url, message) function _onClose(url, message)

View File

@@ -154,5 +154,8 @@ class Server:
case {'remove_temp_token': token}: case {'remove_temp_token': token}:
cls._temp_tokens.remove(token) cls._temp_tokens.remove(token)
case {'init_temp_tokens': tokens}:
cls._temp_tokens = cls._temp_tokens + tokens.items()
case _: case _:
raise ValueError(f'Неподдерживаемый тип PyG2O сообщения: {message}') raise ValueError(f'Неподдерживаемый тип PyG2O сообщения: {message}')