Skip to content
Discussion options

You must be logged in to vote

You can accomplish this using a sensor which monitors to check when the last run of the job occurred & kick off another run if it's been long enough:

from typing import Any
from dagster import (
    RunRequest,
    sensor,
    RunsFilter,
    Definitions,
    SkipReason,
    job,
    SensorEvaluationContext,
)
from datetime import datetime, timedelta


@job
def my_monitored_job():
    ...


# Set this to longer than the time it takes to run the job, since we
# query runs by start time
RUN_START_LOOKBACK_MINS = 10

# Set this to the delay you want to wait before running the job again
DELAY_TO_RUN_JOB_MINS = 2


@sensor(job=my_monitored_job)
def run_job_after_delay_sensor(context: SensorEva…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by benpankow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant