BashSensor

使用 BashSensor 來使用任意指令進行感測。當指令成功時應返回 0,否則返回任何其他值。

airflow/example_dags/example_sensors.py[原始碼]

t3 = BashSensor(task_id="Sensor_succeeds", bash_command="exit 0")

t4 = BashSensor(task_id="Sensor_fails_after_3_seconds", timeout=3, soft_fail=True, bash_command="exit 1")

這個條目是否有幫助?