ryry-cli 2.24__tar.gz → 2.27__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.24/ryry_cli.egg-info → ryry_cli-2.27}/PKG-INFO +1 -1
- ryry_cli-2.27/ryry/constant.py +5 -0
- {ryry_cli-2.24 → ryry_cli-2.27}/ryry/ryry_server_socket.py +19 -2
- {ryry_cli-2.24 → ryry_cli-2.27}/ryry/ryry_widget.py +0 -3
- {ryry_cli-2.24 → ryry_cli-2.27}/ryry/store.py +7 -4
- {ryry_cli-2.24 → ryry_cli-2.27/ryry_cli.egg-info}/PKG-INFO +1 -1
- {ryry_cli-2.24 → ryry_cli-2.27}/setup.py +1 -1
- ryry_cli-2.24/ryry/constant.py +0 -5
- {ryry_cli-2.24 → ryry_cli-2.27}/LICENSE +0 -0
- {ryry_cli-2.24 → ryry_cli-2.27}/README.md +0 -0
- {ryry_cli-2.24 → ryry_cli-2.27}/ryry/__init__.py +0 -0
- {ryry_cli-2.24 → ryry_cli-2.27}/ryry/main.py +0 -0
- {ryry_cli-2.24 → ryry_cli-2.27}/ryry/ryry_service.py +0 -0
- {ryry_cli-2.24 → ryry_cli-2.27}/ryry/ryry_webapi.py +0 -0
- {ryry_cli-2.24 → ryry_cli-2.27}/ryry/script_template/__init__.py +0 -0
- {ryry_cli-2.24 → ryry_cli-2.27}/ryry/script_template/main.py +0 -0
- {ryry_cli-2.24 → ryry_cli-2.27}/ryry/script_template/run.py +0 -0
- {ryry_cli-2.24 → ryry_cli-2.27}/ryry/server_func.py +0 -0
- {ryry_cli-2.24 → ryry_cli-2.27}/ryry/task.py +0 -0
- {ryry_cli-2.24 → ryry_cli-2.27}/ryry/taskUtils.py +0 -0
- {ryry_cli-2.24 → ryry_cli-2.27}/ryry/upload.py +0 -0
- {ryry_cli-2.24 → ryry_cli-2.27}/ryry/utils.py +0 -0
- {ryry_cli-2.24 → ryry_cli-2.27}/ryry_cli.egg-info/SOURCES.txt +0 -0
- {ryry_cli-2.24 → ryry_cli-2.27}/ryry_cli.egg-info/dependency_links.txt +0 -0
- {ryry_cli-2.24 → ryry_cli-2.27}/ryry_cli.egg-info/entry_points.txt +0 -0
- {ryry_cli-2.24 → ryry_cli-2.27}/ryry_cli.egg-info/requires.txt +0 -0
- {ryry_cli-2.24 → ryry_cli-2.27}/ryry_cli.egg-info/top_level.txt +0 -0
- {ryry_cli-2.24 → ryry_cli-2.27}/setup.cfg +0 -0
|
@@ -166,15 +166,32 @@ class RyryShortConnectThread(Thread):
|
|
|
166
166
|
|
|
167
167
|
def run(self):
|
|
168
168
|
print(f" {self.name} start")
|
|
169
|
-
|
|
169
|
+
min_wait_time = 2
|
|
170
|
+
max_wait_time = 10
|
|
171
|
+
wait_time = min_wait_time
|
|
172
|
+
consecutive_step = 2
|
|
173
|
+
consecutive_failures = 0
|
|
174
|
+
max_consecutive_failures = 10
|
|
175
|
+
|
|
170
176
|
while (self.is_running):
|
|
171
177
|
try:
|
|
172
178
|
datas = ryry_webapi.GetTask()
|
|
173
179
|
for it in datas:
|
|
174
180
|
self.executor.appendTask(it, self.taskCallback)
|
|
181
|
+
|
|
182
|
+
# if task empty -> full, set wait_time = max -> min
|
|
183
|
+
if len(datas) > 0:
|
|
184
|
+
consecutive_failures = 0
|
|
185
|
+
wait_time = max(min_wait_time, wait_time - consecutive_step)
|
|
186
|
+
else:
|
|
187
|
+
consecutive_failures += 1
|
|
188
|
+
if consecutive_failures >= max_consecutive_failures:
|
|
189
|
+
wait_time = min(max_wait_time, wait_time + consecutive_step)
|
|
190
|
+
consecutive_failures = 0
|
|
175
191
|
except Exception as ex:
|
|
176
192
|
taskUtils.taskPrint(None, f"{self.name} === exception : {ex}")
|
|
177
|
-
time.sleep(
|
|
193
|
+
time.sleep(wait_time)
|
|
194
|
+
|
|
178
195
|
print(f" {self.name} stop")
|
|
179
196
|
|
|
180
197
|
def markStop(self):
|
|
@@ -126,9 +126,6 @@ def setWidgetData(root, widgetid):
|
|
|
126
126
|
data["widget_id"] = widgetid
|
|
127
127
|
data["name"] = "Demo"
|
|
128
128
|
data["version"] = "1.0"
|
|
129
|
-
data["device_keys"] = [
|
|
130
|
-
utils.generate_unique_id()
|
|
131
|
-
]
|
|
132
129
|
data["cmd"] = os.path.join(root, "main.py")
|
|
133
130
|
with open(os.path.join(root, "config.json"), 'w') as f:
|
|
134
131
|
json.dump(data, f)
|
|
@@ -67,10 +67,13 @@ def insertWidget(widget_id, path):
|
|
|
67
67
|
if "widgets" not in read_data:
|
|
68
68
|
read_data["widgets"] = {}
|
|
69
69
|
widgetsMap = read_data["widgets"]
|
|
70
|
-
|
|
71
|
-
"
|
|
72
|
-
|
|
73
|
-
|
|
70
|
+
if widget_id in widgetsMap:
|
|
71
|
+
widgetsMap[widget_id]["path"] = path
|
|
72
|
+
else:
|
|
73
|
+
widgetsMap[widget_id] = {
|
|
74
|
+
"isBlock": False,
|
|
75
|
+
"path" : path
|
|
76
|
+
}
|
|
74
77
|
for k in list(widgetsMap.keys()):
|
|
75
78
|
if isinstance(widgetsMap[k], (dict)):
|
|
76
79
|
if os.path.exists(widgetsMap[k]["path"]) == False:
|
|
@@ -3,7 +3,7 @@ import os
|
|
|
3
3
|
import subprocess
|
|
4
4
|
import datetime
|
|
5
5
|
|
|
6
|
-
ryry_version = "2.
|
|
6
|
+
ryry_version = "2.27"
|
|
7
7
|
ryry_build_number = int(ryry_version.replace(".",""))
|
|
8
8
|
cur_dir = os.path.dirname(os.path.abspath(__file__))
|
|
9
9
|
constanspy = os.path.join(cur_dir, "ryry", "constant.py")
|
ryry_cli-2.24/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
|