yaml updated

This commit is contained in:
berkay 2024-12-20 12:48:04 +03:00
parent 6089f1cc8e
commit b61f00d61c
2 changed files with 9 additions and 11 deletions

View File

@ -55,16 +55,14 @@ def sender_service():
if is_bank_retrieve_account_records(bank_data=json.dumps(parsed_data)): if is_bank_retrieve_account_records(bank_data=json.dumps(parsed_data)):
print("is_bank_retrieve_account_records is successful") print("is_bank_retrieve_account_records is successful")
today_date = str(arrow.now("GMT+0"))
archive_path = str(Config.ARCHIVE_PATH + today_date + ".json").replace(" ", "")
already_archived = read_json_file(archive_path)
already_archived[today_date] = parsed_data
write_json_file(archive_path, already_archived)
write_json_file(Config.PARSED_PATH, {})
else: else:
print("is_bank_retrieve_account_records is failed") print("is_bank_retrieve_account_records is failed")
return
today_date = str(arrow.now("GMT+0"))
archive_path = str(Config.ARCHIVE_PATH + today_date + ".json").replace(" ", "")
already_archived = read_json_file(archive_path)
already_archived[today_date] = parsed_data
write_json_file(archive_path, already_archived)
write_json_file(Config.PARSED_PATH, {})
return return
@ -96,7 +94,7 @@ def is_bank_retrieve_account_records(bank_data):
new_account_record = AccountRecords.find_or_create(**data_dict) new_account_record = AccountRecords.find_or_create(**data_dict)
new_account_record.save_and_confirm() new_account_record.save_and_confirm()
new_record_list.append(new_account_record.get_dict()) new_record_list.append(new_account_record.get_dict())
print("new_account_record is created", new_account_record.id) print("new_account_record is created", new_account_record.uu_id)
return new_record_list if new_record_list else [] return new_record_list if new_record_list else []

View File

@ -19,13 +19,13 @@ if __name__ == "__main__":
time.sleep(1) time.sleep(1)
except Exception as e: except Exception as e:
err = e err = e
print("Reader Service : ", err) print("Parser Service : ", err)
try: try:
sender_service() sender_service()
time.sleep(1) time.sleep(1)
except Exception as e: except Exception as e:
err = e err = e
print("Reader Service : ", err) print("Sender Service : ", err)
print( print(
datetime.datetime.now().__str__(), datetime.datetime.now().__str__(),
" : system completed a cycle without error...", " : system completed a cycle without error...",