chenzuoli commented on issue #21225: URL: https://github.com/apache/airflow/issues/21225#issuecomment-1594188249
> This is not ideal, but for those who want to kick all their queued tasks to running, here's a snippet i've been using: > > ``` > from airflow import models, settings > from airflow.executors.executor_loader import ExecutorLoader > > session = settings.Session() > tis = session.query(models.TaskInstance).filter(models.TaskInstance.state=='queued') > dagbag = models.DagBag() > for ti in tis: > dag = dagbag.get_dag(ti.dag_id) > task = dag.get_task(ti.task_id) > ti.refresh_from_task(task) > executor = ExecutorLoader.get_default_executor() > executor.job_id = "manual" > executor.start() > executor.queue_task_instance(ti, ignore_all_deps=False, ignore_task_deps=False, ignore_ti_state=False) > executor.heartbeat() > ``` hello @Chris7 , I was wondering where do you place the code to run, add to a python script in the loop? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
