ryry-cli 2.76__tar.gz → 2.78__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-2.76 → ryry_cli-2.78}/PKG-INFO +1 -1
- ryry_cli-2.78/ryry/constant.py +4 -0
- {ryry_cli-2.76 → ryry_cli-2.78}/ryry/ryry_server_socket.py +12 -3
- {ryry_cli-2.76 → ryry_cli-2.78}/ryry/ryry_webapi.py +33 -8
- {ryry_cli-2.76 → ryry_cli-2.78}/ryry_cli.egg-info/PKG-INFO +1 -1
- {ryry_cli-2.76 → ryry_cli-2.78}/setup.py +1 -1
- ryry_cli-2.76/ryry/constant.py +0 -4
- {ryry_cli-2.76 → ryry_cli-2.78}/LICENSE +0 -0
- {ryry_cli-2.76 → ryry_cli-2.78}/README.md +0 -0
- {ryry_cli-2.76 → ryry_cli-2.78}/ryry/__init__.py +0 -0
- {ryry_cli-2.76 → ryry_cli-2.78}/ryry/main.py +0 -0
- {ryry_cli-2.76 → ryry_cli-2.78}/ryry/ryry_service.py +0 -0
- {ryry_cli-2.76 → ryry_cli-2.78}/ryry/ryry_widget.py +0 -0
- {ryry_cli-2.76 → ryry_cli-2.78}/ryry/script_template/__init__.py +0 -0
- {ryry_cli-2.76 → ryry_cli-2.78}/ryry/script_template/main.py +0 -0
- {ryry_cli-2.76 → ryry_cli-2.78}/ryry/script_template/run.py +0 -0
- {ryry_cli-2.76 → ryry_cli-2.78}/ryry/server_func.py +0 -0
- {ryry_cli-2.76 → ryry_cli-2.78}/ryry/store.py +0 -0
- {ryry_cli-2.76 → ryry_cli-2.78}/ryry/task.py +0 -0
- {ryry_cli-2.76 → ryry_cli-2.78}/ryry/taskUtils.py +0 -0
- {ryry_cli-2.76 → ryry_cli-2.78}/ryry/upload.py +0 -0
- {ryry_cli-2.76 → ryry_cli-2.78}/ryry/utils.py +0 -0
- {ryry_cli-2.76 → ryry_cli-2.78}/ryry_cli.egg-info/SOURCES.txt +0 -0
- {ryry_cli-2.76 → ryry_cli-2.78}/ryry_cli.egg-info/dependency_links.txt +0 -0
- {ryry_cli-2.76 → ryry_cli-2.78}/ryry_cli.egg-info/entry_points.txt +0 -0
- {ryry_cli-2.76 → ryry_cli-2.78}/ryry_cli.egg-info/requires.txt +0 -0
- {ryry_cli-2.76 → ryry_cli-2.78}/ryry_cli.egg-info/top_level.txt +0 -0
- {ryry_cli-2.76 → ryry_cli-2.78}/setup.cfg +0 -0
|
@@ -169,12 +169,13 @@ class RyryShortConnectThread(Thread):
|
|
|
169
169
|
|
|
170
170
|
def run(self):
|
|
171
171
|
print(f" {self.name} start")
|
|
172
|
-
min_wait_time =
|
|
173
|
-
max_wait_time =
|
|
172
|
+
min_wait_time = 5
|
|
173
|
+
max_wait_time = 60
|
|
174
174
|
wait_time = min_wait_time
|
|
175
|
-
consecutive_step =
|
|
175
|
+
consecutive_step = 10
|
|
176
176
|
consecutive_failures = 0
|
|
177
177
|
max_consecutive_failures = 10
|
|
178
|
+
last_check_time = 0
|
|
178
179
|
|
|
179
180
|
while (self.is_running):
|
|
180
181
|
try:
|
|
@@ -194,6 +195,14 @@ class RyryShortConnectThread(Thread):
|
|
|
194
195
|
if consecutive_failures >= max_consecutive_failures:
|
|
195
196
|
wait_time = min(max_wait_time, wait_time + consecutive_step)
|
|
196
197
|
consecutive_failures = 0
|
|
198
|
+
|
|
199
|
+
if calendar.timegm(time.gmtime()) - last_check_time > 600:
|
|
200
|
+
last_check_time = calendar.timegm(time.gmtime())
|
|
201
|
+
try:
|
|
202
|
+
min_wait_time, max_wait_time, consecutive_step = ryry_webapi.ServerTaskConfig()
|
|
203
|
+
except:
|
|
204
|
+
pass
|
|
205
|
+
|
|
197
206
|
except Exception as ex:
|
|
198
207
|
taskUtils.taskPrint(None, f"{self.name} === exception : {ex}")
|
|
199
208
|
time.sleep(wait_time)
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import json, os
|
|
2
|
-
import
|
|
3
|
-
import uuid, requests
|
|
4
|
-
import calendar, time
|
|
1
|
+
import json, os, locale, datetime, platform
|
|
2
|
+
import uuid, requests, calendar, time
|
|
5
3
|
|
|
6
4
|
from ryry import store
|
|
7
5
|
from ryry import utils
|
|
@@ -36,11 +34,38 @@ def _aigc_post(func, params, files={}, timeout=10):
|
|
|
36
34
|
return -1, "", ""
|
|
37
35
|
|
|
38
36
|
#======================================== Task Function ==============================
|
|
37
|
+
def ServerTaskConfig():
|
|
38
|
+
r1, r2, r3 = _aigc_post("aigc/task/config", {})
|
|
39
|
+
if r1 != 0:
|
|
40
|
+
raise Exception("")
|
|
41
|
+
|
|
42
|
+
min_wait_time = r3["min_wait_time"]
|
|
43
|
+
max_wait_time = r3["max_wait_time"]
|
|
44
|
+
consecutive_step = r3["step"]
|
|
45
|
+
return min_wait_time, max_wait_time, consecutive_step
|
|
46
|
+
|
|
47
|
+
GLOBAL_EXT_JSON = "{}"
|
|
39
48
|
def _extend():
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
49
|
+
global GLOBAL_EXT_JSON
|
|
50
|
+
if len(GLOBAL_EXT_JSON) < 10:
|
|
51
|
+
extInfo = store.readDeviceInfo()
|
|
52
|
+
extInfo["app"] = constant.app_name + " " + constant.app_version
|
|
53
|
+
extInfo["device"] = platform.system()
|
|
54
|
+
extInfo["device_version"] = platform.version()
|
|
55
|
+
extInfo["device_name"] = platform.node()
|
|
56
|
+
extInfo["device_model"] = platform.machine()
|
|
57
|
+
|
|
58
|
+
try:
|
|
59
|
+
extInfo["ip_address"] = requests.get('https://api.ipify.org').text
|
|
60
|
+
except Exception as e:
|
|
61
|
+
extInfo["ip_address"] = "unknown"
|
|
62
|
+
|
|
63
|
+
system_language, _ = locale.getdefaultlocale()
|
|
64
|
+
system_platform = platform.system().lower()
|
|
65
|
+
extInfo["language"] = system_language if system_language else "unknown"
|
|
66
|
+
extInfo["platform"] = system_platform if system_platform else "unknown"
|
|
67
|
+
GLOBAL_EXT_JSON = json.dumps(extInfo)
|
|
68
|
+
return GLOBAL_EXT_JSON
|
|
44
69
|
|
|
45
70
|
def GetTask():
|
|
46
71
|
widget_map = []
|
ryry_cli-2.76/ryry/constant.py
DELETED
|
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
|