https://dagster.io/ logo
#ask-community
Title
# ask-community
o

Oliver

09/08/2022, 7:35 AM
hey all, is there a way to delete all runs in dagit? I started a backfill and the terminate button for the backfill doesn't seem to be doing anything and I can only manually delete 25 at a time.
d

daniel

09/08/2022, 12:00 PM
Hi Oliver - would a script like this work?
Copy code
from dagster import DagsterInstance

with DagsterInstance.get() as instance:
   while True:
      runs = instance.get_runs(limit=25)
      if not runs:
         break
      for run in runs:
         instance.delete_run(run.run_id)
🌈 1
the terminate button not doing anything sounds unexpected, any more details you can share there about what you're seeing?
There's a tags argument you can add to the get_runs call above to filter it down to just the runs from a particular backfill
o

Oliver

09/08/2022, 11:58 PM
I think it happens somewhat frequently. I have a suspicion that it happens once all jobs have been queued. eg before all jobs are queued cancel works, after it doesn't. Haven't dug into it properly though. I'm on firefox and don't think it would be tied to a specific dagster version