You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
w3_indice= (w3_indice+1) %len(w3_urls) # This will give you the sequence: 0 → 1 → 2 → ... → n → 0 → 1 → 2 → ... → n → 0 ...
82
86
w3=Web3(Web3.HTTPProvider(w3_urls[w3_indice]))
83
-
logger.info(f"Blocks retrieval failed too many times. Changing from w3 RPC n°{old_indice+1} to w3 RPC n°{w3_indice+1}")
87
+
logger.info(f"Blocks retrieval failed too many times. Changing from w3 RPC n°{old_indice+1} to w3 RPC n°{w3_indice+1} [{w3.provider.endpoint_uri.split('//')[1].rsplit('/', 1)[0]}]")
84
88
continue
85
89
90
+
ifnotsuccess:
91
+
logger.info(f"All attempts with the same RPC [{w3.provider.endpoint_uri.split('//')[1].rsplit('/', 1)[0]}] failed.")
92
+
continue
93
+
86
94
decoded_logs=decode_raw_logs_yam(raw_logs)
87
95
88
96
### Add logs to the DB
@@ -124,8 +132,14 @@ def main_indexing():
124
132
logger.info("Received Ctrl+C, shutting down the indexing service...")
125
133
print("Process stopped by user")
126
134
exceptExceptionase:
127
-
logger.error(f"Indexing loop failed with error: {str(e)}", exc_info=True)
128
-
print(f"Indexing loop failed with error: {str(e)}")
135
+
logger.error(f"Indexing loop failed with error: {str(e)}", exc_info=True)
136
+
print(f"Indexing loop failed with error: {str(e)}")
129
137
130
138
if__name__=="__main__":
131
-
main_indexing()
139
+
whileTrue:
140
+
try:
141
+
main_indexing()
142
+
exceptExceptionase:
143
+
logger=logging.getLogger(__name__)
144
+
logger.exception("Fatal error in main_indexing. Restarting in 30 seconds...")
0 commit comments