diff --git a/prefect.yaml b/prefect.yaml index d2014ec..ce982c4 100644 --- a/prefect.yaml +++ b/prefect.yaml @@ -22,7 +22,7 @@ deployments: - bitable - sync schedules: - - cron: "0 17 40 * *" + - cron: "0 8 * * *" timezone: "Asia/Shanghai" active: true work_pool: @@ -43,7 +43,7 @@ deployments: - feishu - notify schedules: - - cron: "0 18 20 * *" + - cron: "0 9 * * *" timezone: "Asia/Shanghai" active: true work_pool: diff --git a/project_bitable_common.py b/project_bitable_common.py index 694f0b6..4fc8197 100644 --- a/project_bitable_common.py +++ b/project_bitable_common.py @@ -304,12 +304,26 @@ class DailySyncContext: config: DailySyncConfig +def _log_to_prefect(level_name: str, message: str) -> None: + try: + from prefect.logging import get_run_logger + + prefect_logger = get_run_logger() + except Exception: + return + log_method = getattr(prefect_logger, level_name.lower(), None) + if callable(log_method): + log_method(message) + + def log_step(message: str) -> None: get_logger().info(message) + _log_to_prefect("INFO", message) def log_debug(message: str) -> None: get_logger().debug(message) + _log_to_prefect("DEBUG", message) def preview_list(values: list[Any], limit: int = 20) -> str: