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

Akira Chang

05/25/2023, 10:29 AM
Hello! I would like to ask if there is a way for
scheduled jobs
to run one run at a time. For example, I have a job that is scheduled to run now. But it takes 1 hour to finish running the job. If the schedule is set to 2 minutes, is there a way to queue the second run? wait for the first run to finish and then execute the second run?
a

Adam Bloom

05/25/2023, 12:20 PM
If you use the
QueuedRunCoordinator
, you could set a tag on that job and only allow one job of that tag to run. See https://docs.dagster.io/guides/limiting-concurrency-in-data-pipelines for a whole lot more info
a

Akira Chang

05/25/2023, 12:44 PM
I see! but does it also work with jobs inside a schedule?
r

rex

05/25/2023, 12:45 PM
yes, scheduled jobs will also follow the configuration that adam linked above!
a

Akira Chang

05/25/2023, 12:57 PM
But its not working, after run1 automatically run2 will start even if run1 didnt terminate😅😭
Screenshot 2023-05-25 at 14.57.51.png
r

rex

05/25/2023, 1:02 PM
What you configured is concurrency *within a job*, which limits the number of ops executing in a run of a job. You want concurrency across jobs runs! Like Adam said, you need to configure: • A tag on the job • Configure your
QueuedRunCoordinator
to enforce a limit of
1
on that tag • Then you will get the behavior you want. You’ll want to follow this section instead: https://docs.dagster.io/guides/limiting-concurrency-in-data-pipelines#configuring-run-level-concurrency
a

Akira Chang

05/26/2023, 7:42 AM
Hello! Thank you for your help! I decided to use this method mentioned in the document since I could not alter the `dagster.yaml`file once the code is deployed. Thank you again for your help! 😊
3 Views