diff --git a/superset/tasks/scheduler.py b/superset/tasks/scheduler.py index df8c3c1c4f168..652d556e8909b 100644 --- a/superset/tasks/scheduler.py +++ b/superset/tasks/scheduler.py @@ -15,7 +15,7 @@ # specific language governing permissions and limitations # under the License. import logging -from datetime import datetime +from datetime import datetime, timezone from celery import Celery from celery.exceptions import SoftTimeLimitExceeded @@ -50,7 +50,7 @@ def scheduler() -> None: datetime.fromisoformat(scheduler.request.expires) - app.config["CELERY_BEAT_SCHEDULER_EXPIRES"] if scheduler.request.expires - else datetime.utcnow() + else datetime.now(tz=timezone.utc) ) for active_schedule in active_schedules: for schedule in cron_schedule_window(