Fixed issues with chunkinator existing already with data when starting
This commit is contained in:
+7
-4
@@ -26,7 +26,10 @@ def pullPolicyExechistories(url, policiesnames, days, outputjson: bool):
|
||||
|
||||
file_path = 'chunkinator.json'
|
||||
|
||||
# Initialize file if it doesn't exist
|
||||
# If chunkintor exists - kill and make new
|
||||
if os.path.exists(file_path):
|
||||
os.remove(file_path)
|
||||
|
||||
if not os.path.exists(file_path):
|
||||
with open(file_path, 'w') as file:
|
||||
json.dump({'error': 'Success', 'response': {'exechistories': []}}, file)
|
||||
@@ -56,10 +59,10 @@ def pullPolicyExechistories(url, policiesnames, days, outputjson: bool):
|
||||
|
||||
checkpoints_processed = round(len(histories) / array_dividend)
|
||||
print(ct.colorText(
|
||||
f"{index + 1}/{checkpoints_processed} checkpoint(s) processed. "
|
||||
f"{'Found with Date Match.' if match_found else ''} Last Checkpoint: {item['checkpoint']}.", "blue"))
|
||||
f"{index + 1}/{checkpoints_processed} checkpoint(s) processed. " # type: ignore
|
||||
f"{'Found with Date Match.' if match_found else ''} Last Checkpoint: {item['checkpoint']}.", "blue")) # type: ignore
|
||||
|
||||
checkpoint = item['checkpoint']
|
||||
checkpoint = item['checkpoint'] # type: ignore
|
||||
|
||||
if match_found:
|
||||
for item in histories:
|
||||
|
||||
Reference in New Issue
Block a user