ryry-cli 4.18__tar.gz → 4.20__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.
- {ryry_cli-4.18/ryry_cli.egg-info → ryry_cli-4.20}/PKG-INFO +1 -1
- {ryry_cli-4.18 → ryry_cli-4.20}/ryry/constant.py +2 -2
- {ryry_cli-4.18 → ryry_cli-4.20}/ryry/daemon_base.py +10 -0
- {ryry_cli-4.18 → ryry_cli-4.20}/ryry/ryry_webapi.py +13 -0
- {ryry_cli-4.18 → ryry_cli-4.20}/ryry/shared_memory.py +0 -1
- {ryry_cli-4.18 → ryry_cli-4.20}/ryry/store.py +1 -1
- {ryry_cli-4.18 → ryry_cli-4.20/ryry_cli.egg-info}/PKG-INFO +1 -1
- {ryry_cli-4.18 → ryry_cli-4.20}/setup.py +1 -1
- {ryry_cli-4.18 → ryry_cli-4.20}/LICENSE +0 -0
- {ryry_cli-4.18 → ryry_cli-4.20}/README.md +0 -0
- {ryry_cli-4.18 → ryry_cli-4.20}/ryry/__init__.py +0 -0
- {ryry_cli-4.18 → ryry_cli-4.20}/ryry/daemon_manager.py +0 -0
- {ryry_cli-4.18 → ryry_cli-4.20}/ryry/main.py +0 -0
- {ryry_cli-4.18 → ryry_cli-4.20}/ryry/ryry_server_socket.py +0 -0
- {ryry_cli-4.18 → ryry_cli-4.20}/ryry/ryry_service.py +0 -0
- {ryry_cli-4.18 → ryry_cli-4.20}/ryry/ryry_widget.py +0 -0
- {ryry_cli-4.18 → ryry_cli-4.20}/ryry/script_template/__init__.py +0 -0
- {ryry_cli-4.18 → ryry_cli-4.20}/ryry/script_template/daemon.py +0 -0
- {ryry_cli-4.18 → ryry_cli-4.20}/ryry/script_template/main.py +0 -0
- {ryry_cli-4.18 → ryry_cli-4.20}/ryry/script_template/run.py +0 -0
- {ryry_cli-4.18 → ryry_cli-4.20}/ryry/server_func.py +0 -0
- {ryry_cli-4.18 → ryry_cli-4.20}/ryry/task.py +0 -0
- {ryry_cli-4.18 → ryry_cli-4.20}/ryry/taskUtils.py +0 -0
- {ryry_cli-4.18 → ryry_cli-4.20}/ryry/upload.py +0 -0
- {ryry_cli-4.18 → ryry_cli-4.20}/ryry/utils.py +0 -0
- {ryry_cli-4.18 → ryry_cli-4.20}/ryry_cli.egg-info/SOURCES.txt +0 -0
- {ryry_cli-4.18 → ryry_cli-4.20}/ryry_cli.egg-info/dependency_links.txt +0 -0
- {ryry_cli-4.18 → ryry_cli-4.20}/ryry_cli.egg-info/entry_points.txt +0 -0
- {ryry_cli-4.18 → ryry_cli-4.20}/ryry_cli.egg-info/requires.txt +0 -0
- {ryry_cli-4.18 → ryry_cli-4.20}/ryry_cli.egg-info/top_level.txt +0 -0
- {ryry_cli-4.18 → ryry_cli-4.20}/setup.cfg +0 -0
|
@@ -5,6 +5,7 @@ import time
|
|
|
5
5
|
import signal
|
|
6
6
|
import threading
|
|
7
7
|
from typing import Optional, Dict, Any
|
|
8
|
+
from ryry import ryry_webapi
|
|
8
9
|
|
|
9
10
|
class SimpleDaemonBase:
|
|
10
11
|
"""
|
|
@@ -223,6 +224,9 @@ class SimpleDaemonBase:
|
|
|
223
224
|
|
|
224
225
|
# 主循环
|
|
225
226
|
self.running = True
|
|
227
|
+
last_status_report_time = 0 # 上次状态上报时间
|
|
228
|
+
status_report_interval = 60 # 状态上报间隔(秒)
|
|
229
|
+
|
|
226
230
|
while self.running:
|
|
227
231
|
try:
|
|
228
232
|
# 处理命令
|
|
@@ -231,6 +235,12 @@ class SimpleDaemonBase:
|
|
|
231
235
|
# 执行循环函数
|
|
232
236
|
self.loop_function()
|
|
233
237
|
|
|
238
|
+
# 每分钟报告一次状态
|
|
239
|
+
current_time = time.time()
|
|
240
|
+
if current_time - last_status_report_time >= status_report_interval:
|
|
241
|
+
ryry_webapi.widgetStatusReport(self.widget_id, self.health_check())
|
|
242
|
+
last_status_report_time = current_time
|
|
243
|
+
|
|
234
244
|
time.sleep(1)
|
|
235
245
|
except KeyboardInterrupt:
|
|
236
246
|
print(f"【{self.widget_name}】收到KeyboardInterrupt", file=sys.stderr)
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import json, os, datetime
|
|
2
2
|
import uuid, requests, calendar, time
|
|
3
|
+
import urllib3
|
|
4
|
+
urllib3.disable_warnings()
|
|
5
|
+
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
|
|
3
6
|
from requests.adapters import HTTPAdapter
|
|
4
7
|
from urllib3.util.retry import Retry
|
|
5
8
|
from urllib.parse import urlparse, urlunparse
|
|
@@ -332,6 +335,16 @@ def upload(localFilePath, ext, keepItAlways=False):
|
|
|
332
335
|
pass
|
|
333
336
|
raise Exception("all upload target is fail!")
|
|
334
337
|
|
|
338
|
+
def widgetStatusReport(widget_id, data):
|
|
339
|
+
r1, r2, r3 = _aigc_post("aigc/task/widgetStatus", {
|
|
340
|
+
"data" : data,
|
|
341
|
+
"widget_id" : widget_id,
|
|
342
|
+
"extend": store.extend()
|
|
343
|
+
})
|
|
344
|
+
if r1 != 0:
|
|
345
|
+
raise Exception(f"report widget status fail!, reason={r2}")
|
|
346
|
+
return r3
|
|
347
|
+
|
|
335
348
|
def uploadWidget(widget_id, name, whl, ext, version):
|
|
336
349
|
with open(whl, "rb") as f:
|
|
337
350
|
files = { 'file':f }
|
|
@@ -155,7 +155,7 @@ def extend():
|
|
|
155
155
|
_genExtend()
|
|
156
156
|
elif read_data["extend"].get("device_id", "") != read_data.get("deviceInfo", {}).get("device_id", ""):
|
|
157
157
|
_genExtend()
|
|
158
|
-
elif read_data["extend"].get("app", "") == "ryry-cli 4.
|
|
158
|
+
elif read_data["extend"].get("app", "") == "ryry-cli 4.20":
|
|
159
159
|
_genExtend()
|
|
160
160
|
else:
|
|
161
161
|
_genExtend()
|
|
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
|