Update parser.py
This commit is contained in:
parent
fa0e73280d
commit
db8d3ccc86
10
parser.py
10
parser.py
@ -12,6 +12,8 @@ def is_json(myjson):
|
||||
return True
|
||||
|
||||
def parse_logs():
|
||||
start_time = time.time()
|
||||
while True:
|
||||
unsuccessful_attempts = 0
|
||||
current_retry = 0
|
||||
max_retry = 0
|
||||
@ -46,11 +48,17 @@ def parse_logs():
|
||||
if current_retry == max_retry:
|
||||
print(f"Max Retry Reached: {data}", flush=True)
|
||||
return False, "Max Retry Reached"
|
||||
except Exception as e:
|
||||
print(f"Exception occurred: {e}", flush=True)
|
||||
finally:
|
||||
process.stdout.close()
|
||||
|
||||
print("Sleeping before next log request...", flush=True)
|
||||
time.sleep(5)
|
||||
time.sleep(30)
|
||||
|
||||
if time.time() - start_time > 30 * 60:
|
||||
print("Timeout reached: 30 minutes elapsed without success.", flush=True)
|
||||
return False, "Timeout reached: 30 minutes elapsed without success."
|
||||
|
||||
return False, "No Success"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user