Skip to content

Commit f8ad301

Browse files
authored
Merge branch 'dependabot-updates' into dependabot/pip/dependabot-updates/pip-23.2.1
2 parents 9ea5731 + dba94d2 commit f8ad301

File tree

4 files changed

+110
-36
lines changed

4 files changed

+110
-36
lines changed

coding-requirements.txt

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ansible==8.1.0
22
ansible-core==2.15.1
3-
cryptography==41.0.2
3+
cryptography==41.0.3
44
cffi==1.15.1
55
pycparser==2.21
66
Jinja2==3.1.2
@@ -11,15 +11,15 @@ ansible==8.1.0
1111
ansible-lint==6.17.2
1212
ansible-compat==4.1.2
1313
ansible-core==2.15.1
14-
cryptography==41.0.2
14+
cryptography==41.0.3
1515
cffi==1.15.1
1616
pycparser==2.21
1717
Jinja2==3.1.2
1818
MarkupSafe==2.1.3
1919
packaging==23.1
2020
PyYAML==6.0
2121
resolvelib==1.0.1
22-
jsonschema==4.18.0
22+
jsonschema==4.18.6
2323
attrs==23.1.0
2424
jsonschema-specifications==2023.6.1
2525
referencing==0.29.1
@@ -33,7 +33,7 @@ ansible-lint==6.17.2
3333
PyYAML==6.0
3434
subprocess-tee==0.4.1
3535
ansible-core==2.15.1
36-
cryptography==41.0.2
36+
cryptography==41.0.3
3737
cffi==1.15.1
3838
pycparser==2.21
3939
Jinja2==3.1.2
@@ -46,10 +46,10 @@ ansible-lint==6.17.2
4646
mypy-extensions==1.0.0
4747
packaging==23.1
4848
pathspec==0.11.1
49-
platformdirs==3.8.1
49+
platformdirs==3.10.0
5050
tomli==2.0.1
5151
filelock==3.12.2
52-
jsonschema==4.18.0
52+
jsonschema==4.18.6
5353
attrs==23.1.0
5454
jsonschema-specifications==2023.6.1
5555
referencing==0.29.1
@@ -63,7 +63,7 @@ ansible-lint==6.17.2
6363
pathspec==0.11.1
6464
PyYAML==6.0
6565
requests==2.31.0
66-
certifi==2023.7.22
66+
certifi==2023.5.7
6767
charset-normalizer==3.2.0
6868
idna==3.4
6969
urllib3==2.0.3
@@ -80,7 +80,7 @@ ansible-lint==6.17.2
8080
pathspec==0.11.1
8181
PyYAML==6.0
8282
bandit==1.7.5
83-
GitPython==3.1.31
83+
GitPython==3.1.32
8484
gitdb==4.0.10
8585
smmap==5.0.0
8686
PyYAML==6.0
@@ -94,7 +94,7 @@ graphviz==0.20.1
9494
pip-autoremove==0.10.0
9595
pip==23.2.1
9696
setuptools==68.0.0
97-
pipdeptree==2.9.4
97+
pipdeptree==2.12.0
9898
pylint==2.17.4
9999
astroid==2.15.6
100100
lazy-object-proxy==1.9.0
@@ -103,25 +103,25 @@ pylint==2.17.4
103103
dill==0.3.6
104104
isort==5.12.0
105105
mccabe==0.7.0
106-
platformdirs==3.8.1
106+
platformdirs==3.10.0
107107
tomli==2.0.1
108108
tomlkit==0.11.8
109109
pywinrm==0.4.3
110110
requests==2.31.0
111-
certifi==2023.7.22
111+
certifi==2023.5.7
112112
charset-normalizer==3.2.0
113113
idna==3.4
114114
urllib3==2.0.3
115115
requests-ntlm==1.2.0
116-
cryptography==41.0.2
116+
cryptography==41.0.3
117117
cffi==1.15.1
118118
pycparser==2.21
119119
pyspnego==0.9.1
120-
cryptography==41.0.2
120+
cryptography==41.0.3
121121
cffi==1.15.1
122122
pycparser==2.21
123123
requests==2.31.0
124-
certifi==2023.7.22
124+
certifi==2023.5.7
125125
charset-normalizer==3.2.0
126126
idna==3.4
127127
urllib3==2.0.3

requirements.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ansible==8.1.0
22
ansible-core==2.15.1
3-
cryptography==41.0.2
3+
cryptography==41.0.1
44
cffi==1.15.1
55
pycparser==2.21
66
Jinja2==3.1.2
@@ -11,20 +11,20 @@ ansible==8.1.0
1111
pip==23.2.1
1212
pywinrm==0.4.3
1313
requests==2.31.0
14-
certifi==2023.7.22
14+
certifi==2023.5.7
1515
charset-normalizer==3.2.0
1616
idna==3.4
1717
urllib3==2.0.3
1818
requests-ntlm==1.2.0
19-
cryptography==41.0.2
19+
cryptography==41.0.1
2020
cffi==1.15.1
2121
pycparser==2.21
2222
pyspnego==0.9.1
23-
cryptography==41.0.2
23+
cryptography==41.0.1
2424
cffi==1.15.1
2525
pycparser==2.21
2626
requests==2.31.0
27-
certifi==2023.7.22
27+
certifi==2023.5.7
2828
charset-normalizer==3.2.0
2929
idna==3.4
3030
urllib3==2.0.3

tdarr-noding/src/tdarr/logic.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def search_for_failed_health_checks(Server):
7070
payload, headers = Tdarr_Logic.payload_and_headers_file_modification("error")
7171

7272
response = requests.post(
73-
Server.search, json=payload, headers=headers, timeout=10
73+
Server.search, json=payload, headers=headers, timeout=30
7474
)
7575

7676
response = json.loads(response.text)
@@ -93,7 +93,7 @@ def search_for_skipped_transcodes(Server, container_type):
9393
payload, headers = Tdarr_Logic.payload_and_headers_file_modification("")
9494

9595
response = requests.post(
96-
Server.search, json=payload, headers=headers, timeout=10
96+
Server.search, json=payload, headers=headers, timeout=30
9797
)
9898

9999
response = json.loads(response.text)
@@ -126,7 +126,7 @@ def search_for_failed_transcodes(Server):
126126
)
127127

128128
response = requests.post(
129-
Server.search, json=payload, headers=headers, timeout=10
129+
Server.search, json=payload, headers=headers, timeout=30
130130
)
131131

132132
response = json.loads(response.text)
@@ -158,7 +158,7 @@ def search_for_successful_transcodes(Server):
158158
)
159159

160160
response = requests.post(
161-
Server.search, json=payload, headers=headers, timeout=10
161+
Server.search, json=payload, headers=headers, timeout=30
162162
)
163163

164164
response = json.loads(response.text)
@@ -188,7 +188,7 @@ def search_for_queued_transcodes(Server):
188188
payload, headers = Tdarr_Logic.payload_and_headers_file_modification("Queued")
189189

190190
response = requests.post(
191-
Server.search, json=payload, headers=headers, timeout=10
191+
Server.search, json=payload, headers=headers, timeout=30
192192
)
193193

194194
response = json.loads(response.text)

tdarr-noding/src/workhorse_class.py

Lines changed: 86 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,41 @@ def verify_primary_running(self):
209209
# check if primary node is running
210210
primary_node = self.Server.primary_node
211211

212+
# check if non-primary nodes are running
213+
online_nodes = []
214+
for node_name, node_class in self.node_dictionary.items():
215+
if node_class.online:
216+
online_nodes.append(node_name)
217+
218+
# pop primary node from online nodes list
219+
online_nodes.pop(online_nodes.index(primary_node))
220+
221+
# find nodes with and without work
222+
nodes_with_work, nodes_without_work = tdarr.Tdarr_Logic.find_nodes_with_work(
223+
self.Server
224+
)
225+
226+
for node_name in online_nodes:
227+
if node_name in nodes_with_work:
228+
# set node to going down
229+
self.Status.NodeStatusMaster.update_directive(node_name, "Going Down")
230+
231+
elif node_name in nodes_without_work:
232+
# shutdown node
233+
# set workers to zero
234+
tdarr.Tdarr_Orders.reset_workers_to_zero(
235+
self.Server, node_name, self.node_dictionary
236+
)
237+
# order shutdown
238+
node_interactions.HostLogic.kill_node(
239+
self.Configuration, self.node_dictionary, node_name, self.Status
240+
)
241+
# set node status to offline
242+
self.node_dictionary[node_name].line_state("Offline")
243+
244+
# set node directive to sleep
245+
self.Status.NodeStatusMaster.update_directive(node_name, "Sleeping")
246+
212247
# check if primary node is offline
213248
if not self.node_dictionary[primary_node].online:
214249
self.NormalHelpersClass.activate_node(primary_node)
@@ -220,23 +255,62 @@ def verify_primary_running(self):
220255
# self.Status.print_status_file()
221256

222257
# when primary node is online
258+
# update nodes and check if primary node is online
259+
self.update_classes()
223260

224-
current_errored_transcodes_quantity = (
225-
self.NormalHelpersClass.number_of_errored_transcodes(self.Server)
226-
)
227-
previously_errored_transcode_quantity = self.Status.errored_transcodes_quantity
261+
if self.node_dictionary[primary_node].online:
262+
current_errored_transcodes_quantity = (
263+
self.NormalHelpersClass.number_of_errored_transcodes(self.Server)
264+
)
265+
previously_errored_transcode_quantity = (
266+
self.Status.errored_transcodes_quantity
267+
)
228268

229-
if current_errored_transcodes_quantity > previously_errored_transcode_quantity:
230-
# Call Refresh
231-
self.refresh()
269+
if previously_errored_transcode_quantity is not None:
270+
if (
271+
current_errored_transcodes_quantity
272+
> previously_errored_transcode_quantity
273+
):
274+
# Call Refresh
275+
self.refresh()
232276

233-
# Set status to refreshed
234-
self.Status.change_state("Refreshed")
277+
# Set status to refreshed
278+
self.Status.change_state("Refreshed")
235279

236-
# print status again
237-
self.Status.print_status_file()
280+
# print status again
281+
self.Status.print_status_file()
282+
283+
self.post_refresh()
284+
else:
285+
# check quantity of work
286+
quantity_of_work, _ = self.NormalHelpersClass.work_quantity_finder()
287+
288+
# check if quantity of work is greater than zero
289+
if quantity_of_work > 0:
290+
# change status to normal
291+
self.Status.change_state("Normal")
292+
293+
# print status again
294+
self.Status.print_status_file()
238295

239-
self.post_refresh()
296+
else:
297+
# Call Refresh
298+
self.refresh()
299+
300+
# Set status to refreshed
301+
self.Status.change_state("Refreshed")
302+
303+
# print status again
304+
self.Status.print_status_file()
305+
306+
self.post_refresh()
307+
308+
else:
309+
# change status to normal
310+
self.Status.change_state("Normal")
311+
312+
# print status file again
313+
self.Status.print_status_file()
240314

241315
def post_refresh(self):
242316
print("SECTION INFO: Starting workhorse 'post_refresh'")

0 commit comments

Comments
 (0)