Hi, I’m using Dagster 1.2.1. This is my sensor fu...
# ask-community
b
Hi, I’m using Dagster 1.2.1. This is my sensor function, I set this sensor on
DagsterRunStatus.STARTED
Copy code
@run_status_sensor(run_status=DagsterRunStatus.STARTED, monitor_all_repositories=True,
                   minimum_interval_seconds=60, default_status=DefaultSensorStatus.RUNNING)
def run_started_sensor(context):
    # This assumes only a single Asset is included in the Run
    <http://context.log.info|context.log.info>(f"test started 1: {context.dagster_run.asset_selection}")
    <http://context.log.info|context.log.info>(f"test started 2: {context.dagster_run}")
However, from the logs I see
DagsterRunStatus.CANCELED
. Does anyone know what’s going on?
s
Hi Brian, if a run starts but is later cancelled, your sensor will still be called because it's called for every RUN_STARTED event. However, the current state of the run is CANCELLED.
b
Thank you Sandy, this is clear to me.