"""Model for tracking script execution status in MySQL.""" from datetime import datetime import config from src.connectors import mysql as mysql_connector from src.sql import mysql as mysql_queries SCRIPT_NAME = config.SERVICE_NAME def update_last_run(run_time: datetime) -> None: """Update the last_run timestamp for this script. Args: run_time (datetime): The timestamp to record as the last run. """ mysql_connector.execute_query( mysql_queries.UPDATE_LAST_RUN, (run_time.strftime('%Y-%m-%d %H:%M:%S'), SCRIPT_NAME), fetch=False, )