mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-24 05:41:40 +00:00
fix(gateway): keep QQBot reconnect loop alive
This commit is contained in:
parent
f0e46c5e9e
commit
8199ec3803
2 changed files with 30 additions and 2 deletions
|
|
@ -4,6 +4,7 @@ import asyncio
|
|||
import json
|
||||
import os
|
||||
import sys
|
||||
from types import SimpleNamespace
|
||||
from unittest import mock
|
||||
|
||||
import pytest
|
||||
|
|
@ -578,6 +579,7 @@ class TestWaitForReconnection:
|
|||
async def reconnect_after_delay():
|
||||
await asyncio.sleep(0.3)
|
||||
adapter._running = True
|
||||
adapter._ws = SimpleNamespace(closed=False)
|
||||
|
||||
asyncio.get_event_loop().create_task(reconnect_after_delay())
|
||||
|
||||
|
|
@ -603,6 +605,7 @@ class TestWaitForReconnection:
|
|||
"""send() should not wait when already connected."""
|
||||
adapter = self._make_adapter(app_id="a", client_secret="b")
|
||||
adapter._running = True
|
||||
adapter._ws = SimpleNamespace(closed=False)
|
||||
adapter._http_client = mock.MagicMock()
|
||||
|
||||
async def fake_api_request(*args, **kwargs):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue