22-06-2026 2nd commit

This commit is contained in:
Ankit Malik
2026-06-22 13:22:16 +05:30
parent e1bd387849
commit 75fc088c68
2 changed files with 305 additions and 2 deletions
+40 -2
View File
@@ -14,7 +14,7 @@
from __future__ import annotations
from time import sleep
import sys
from datetime import date, datetime, timedelta
@@ -254,4 +254,42 @@ def main():
if __name__ == "__main__":
main()
for attempt in range(3):
try:
main()
with open("Pipeline_config.yml", "r") as f:
config = yaml.safe_load(f)
config["pipeline"]["last_successful_run_date"] = str(date.today())
with open("Pipeline_config.yml", "w") as f:
yaml.safe_dump(config, f, sort_keys=False)
log.info(
f"Pipeline completed successfully. "
f"last_successful_run_date={date.today()}"
)
break
except Exception as e:
with open("Pipeline_config.yml", "r") as f:
config = yaml.safe_load(f)
config["pipeline"]["run_date"] = str(date.today())
with open("Pipeline_config.yml", "w") as f:
yaml.safe_dump(config, f, sort_keys=False)
if attempt == 2:
raise
log.warning(
f"Pipeline failed. Retry {attempt + 1}/3. Error: {e}"
)
sleep(5)