maitai-python 1.1.16b0__tar.gz → 1.1.17__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {maitai_python-1.1.16b0 → maitai_python-1.1.17}/PKG-INFO +1 -1
- {maitai_python-1.1.16b0 → maitai_python-1.1.17}/maitai_common/processes/websocket_listener_thread.py +5 -0
- {maitai_python-1.1.16b0 → maitai_python-1.1.17}/maitai_common/version.py +1 -1
- {maitai_python-1.1.16b0 → maitai_python-1.1.17}/maitai_python.egg-info/PKG-INFO +1 -1
- {maitai_python-1.1.16b0 → maitai_python-1.1.17}/README.md +0 -0
- {maitai_python-1.1.16b0 → maitai_python-1.1.17}/maitai/__init__.py +0 -0
- {maitai_python-1.1.16b0 → maitai_python-1.1.17}/maitai/_azure.py +0 -0
- {maitai_python-1.1.16b0 → maitai_python-1.1.17}/maitai/_config.py +0 -0
- {maitai_python-1.1.16b0 → maitai_python-1.1.17}/maitai/_config_listener_thread.py +0 -0
- {maitai_python-1.1.16b0 → maitai_python-1.1.17}/maitai/_context.py +0 -0
- {maitai_python-1.1.16b0 → maitai_python-1.1.17}/maitai/_evaluator.py +0 -0
- {maitai_python-1.1.16b0 → maitai_python-1.1.17}/maitai/_inference.py +0 -0
- {maitai_python-1.1.16b0 → maitai_python-1.1.17}/maitai/_maitai.py +0 -0
- {maitai_python-1.1.16b0 → maitai_python-1.1.17}/maitai/_maitai_async.py +0 -0
- {maitai_python-1.1.16b0 → maitai_python-1.1.17}/maitai/_maitai_client.py +0 -0
- {maitai_python-1.1.16b0 → maitai_python-1.1.17}/maitai/_types.py +0 -0
- {maitai_python-1.1.16b0 → maitai_python-1.1.17}/maitai/_utils.py +0 -0
- {maitai_python-1.1.16b0 → maitai_python-1.1.17}/maitai/tools/__init__.py +0 -0
- {maitai_python-1.1.16b0 → maitai_python-1.1.17}/maitai_common/__init__.py +0 -0
- {maitai_python-1.1.16b0 → maitai_python-1.1.17}/maitai_common/config/__init__.py +0 -0
- {maitai_python-1.1.16b0 → maitai_python-1.1.17}/maitai_common/config/config_service.py +0 -0
- {maitai_python-1.1.16b0 → maitai_python-1.1.17}/maitai_common/processes/__init__.py +0 -0
- {maitai_python-1.1.16b0 → maitai_python-1.1.17}/maitai_common/processes/io_thread.py +0 -0
- {maitai_python-1.1.16b0 → maitai_python-1.1.17}/maitai_common/utils/__init__.py +0 -0
- {maitai_python-1.1.16b0 → maitai_python-1.1.17}/maitai_common/utils/proto_utils.py +0 -0
- {maitai_python-1.1.16b0 → maitai_python-1.1.17}/maitai_common/utils/types.py +0 -0
- {maitai_python-1.1.16b0 → maitai_python-1.1.17}/maitai_gen/__init__.py +0 -0
- {maitai_python-1.1.16b0 → maitai_python-1.1.17}/maitai_gen/application/__init__.py +0 -0
- {maitai_python-1.1.16b0 → maitai_python-1.1.17}/maitai_gen/backtest/__init__.py +0 -0
- {maitai_python-1.1.16b0 → maitai_python-1.1.17}/maitai_gen/billing/__init__.py +0 -0
- {maitai_python-1.1.16b0 → maitai_python-1.1.17}/maitai_gen/chat/__init__.py +0 -0
- {maitai_python-1.1.16b0 → maitai_python-1.1.17}/maitai_gen/company/__init__.py +0 -0
- {maitai_python-1.1.16b0 → maitai_python-1.1.17}/maitai_gen/config/__init__.py +0 -0
- {maitai_python-1.1.16b0 → maitai_python-1.1.17}/maitai_gen/embedding/__init__.py +0 -0
- {maitai_python-1.1.16b0 → maitai_python-1.1.17}/maitai_gen/event/__init__.py +0 -0
- {maitai_python-1.1.16b0 → maitai_python-1.1.17}/maitai_gen/inference/__init__.py +0 -0
- {maitai_python-1.1.16b0 → maitai_python-1.1.17}/maitai_gen/key/__init__.py +0 -0
- {maitai_python-1.1.16b0 → maitai_python-1.1.17}/maitai_gen/metric/__init__.py +0 -0
- {maitai_python-1.1.16b0 → maitai_python-1.1.17}/maitai_gen/model/__init__.py +0 -0
- {maitai_python-1.1.16b0 → maitai_python-1.1.17}/maitai_gen/notification/__init__.py +0 -0
- {maitai_python-1.1.16b0 → maitai_python-1.1.17}/maitai_gen/sandbox/__init__.py +0 -0
- {maitai_python-1.1.16b0 → maitai_python-1.1.17}/maitai_gen/sentinel/__init__.py +0 -0
- {maitai_python-1.1.16b0 → maitai_python-1.1.17}/maitai_gen/session/__init__.py +0 -0
- {maitai_python-1.1.16b0 → maitai_python-1.1.17}/maitai_python.egg-info/SOURCES.txt +0 -0
- {maitai_python-1.1.16b0 → maitai_python-1.1.17}/maitai_python.egg-info/dependency_links.txt +0 -0
- {maitai_python-1.1.16b0 → maitai_python-1.1.17}/maitai_python.egg-info/requires.txt +0 -0
- {maitai_python-1.1.16b0 → maitai_python-1.1.17}/maitai_python.egg-info/top_level.txt +0 -0
- {maitai_python-1.1.16b0 → maitai_python-1.1.17}/setup.cfg +0 -0
- {maitai_python-1.1.16b0 → maitai_python-1.1.17}/setup.py +0 -0
{maitai_python-1.1.16b0 → maitai_python-1.1.17}/maitai_common/processes/websocket_listener_thread.py
RENAMED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import threading
|
|
2
|
+
import time
|
|
2
3
|
|
|
3
4
|
import websocket
|
|
4
5
|
|
|
@@ -17,6 +18,7 @@ class WebsocketListenerThread(IOThread):
|
|
|
17
18
|
self.ws_threads = []
|
|
18
19
|
self.closing_ws = False # Add a shutdown flag
|
|
19
20
|
self.connection_established_event = threading.Event() # Add an event attribute
|
|
21
|
+
self.retry_backoff = 1
|
|
20
22
|
|
|
21
23
|
def connect_to_websocket(self):
|
|
22
24
|
self.connection_established_event.clear() # Clear the event before attempting a new connection
|
|
@@ -31,6 +33,7 @@ class WebsocketListenerThread(IOThread):
|
|
|
31
33
|
# Starting a new thread to handle the WebSocket connection
|
|
32
34
|
ws_thread = threading.Thread(target=self.ws.run_forever, name="WebsocketThread")
|
|
33
35
|
ws_thread.start()
|
|
36
|
+
self.retry_backoff = 1
|
|
34
37
|
tmp = [ws_thread]
|
|
35
38
|
for t in self.ws_threads:
|
|
36
39
|
if t.is_alive():
|
|
@@ -54,6 +57,8 @@ class WebsocketListenerThread(IOThread):
|
|
|
54
57
|
|
|
55
58
|
def on_error(self, ws, error):
|
|
56
59
|
print(f"WebSocket error: {error}. Reconnecting...")
|
|
60
|
+
time.sleep(self.retry_backoff)
|
|
61
|
+
self.retry_backoff *= 2
|
|
57
62
|
self.connect_to_websocket()
|
|
58
63
|
|
|
59
64
|
def initialize(self):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|