py-near 1.1.18__py3-none-any.whl → 1.1.20__py3-none-any.whl
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.
py_near/providers.py
CHANGED
@@ -69,29 +69,27 @@ class JsonProvider(object):
|
|
69
69
|
last_block_ts = datetime.datetime.fromisoformat(
|
70
70
|
data["sync_info"]["latest_block_time"]
|
71
71
|
)
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
- datetime.timedelta(minutes=1)
|
72
|
+
diff = (
|
73
|
+
datetime.datetime.utcnow().timestamp()
|
74
|
+
- last_block_ts.timestamp()
|
76
75
|
)
|
76
|
+
is_syncing = diff > 60
|
77
77
|
else:
|
78
78
|
is_syncing = False
|
79
|
-
if
|
80
|
-
|
81
|
-
(
|
82
|
-
rpc_addr,
|
83
|
-
datetime.datetime.utcnow().timestamp()
|
84
|
-
- timestamp_start,
|
85
|
-
)
|
86
|
-
)
|
79
|
+
if is_syncing:
|
80
|
+
logger.error(f"Remove async RPC : {rpc_addr} ({diff})")
|
87
81
|
continue
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
f"Remove rpc because of error {r.status}: {rpc_addr}"
|
82
|
+
available_rpcs.append(
|
83
|
+
(
|
84
|
+
rpc_addr,
|
85
|
+
datetime.datetime.utcnow().timestamp()
|
86
|
+
- timestamp_start,
|
94
87
|
)
|
88
|
+
)
|
89
|
+
else:
|
90
|
+
logger.error(
|
91
|
+
f"Remove rpc because of error {r.status}: {rpc_addr}"
|
92
|
+
)
|
95
93
|
except Exception as e:
|
96
94
|
if rpc_addr in self._available_rpcs:
|
97
95
|
logger.error(f"Remove rpc: {e}")
|
@@ -20,10 +20,10 @@ py_near/exceptions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuF
|
|
20
20
|
py_near/exceptions/exceptions.py,sha256=qG-aBYAsyCXcdzmZ84n9wVHCLkuWnd16XZTVprJfUVM,5462
|
21
21
|
py_near/exceptions/provider.py,sha256=K-wexgjPJ8sw42JePwaP7R5dJEIn9DoFJRvVcURsx6s,7718
|
22
22
|
py_near/models.py,sha256=JHoJdghtc25WDbf6kRPf6IIqVRq46upexMzmBPB1U40,9534
|
23
|
-
py_near/providers.py,sha256=
|
23
|
+
py_near/providers.py,sha256=LfGfEK6zFzRp3RgXNY70_LlCzZw4_JvvMd7w337_F1I,12431
|
24
24
|
py_near/transactions.py,sha256=QAXegv2JpKISk92NaChtIH6-QPHrcWbrwdKH_lH4TsU,3186
|
25
25
|
py_near/utils.py,sha256=FirRH93ydH1cwjn0-sNrZeIn3BRD6QHedrP2VkAdJ6g,126
|
26
|
-
py_near-1.1.
|
27
|
-
py_near-1.1.
|
28
|
-
py_near-1.1.
|
29
|
-
py_near-1.1.
|
26
|
+
py_near-1.1.20.dist-info/LICENSE,sha256=I_GOA9xJ35FiL-KnYXZJdATkbO2KcV2dK2enRGVxzKM,1023
|
27
|
+
py_near-1.1.20.dist-info/METADATA,sha256=a8Setz2rDy24pHh9rS_6LiWhAJm-GAOAvP4VRiDy71A,4713
|
28
|
+
py_near-1.1.20.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
|
29
|
+
py_near-1.1.20.dist-info/RECORD,,
|
File without changes
|
File without changes
|