Stop worker if already running and start the new one. #287
Replies: 1 comment
-
To handle multiple instances you can consider ConcurrencyLayer or
GlobalConcurrencyLayer.
To stop a job, you can just do an early return.
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
geofmureithi
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, I am using
WorkerBuilder
withCronStream
and if I have a job that starts every 10 seconds I would like to cancel the previous instance of that job if it is still running because sometimes I might have long running tasks that are not yet completed. How can I achieve that?The end goal is if I have multiple workers I want only max one instance of them to be running at all times.
Also how can i stop the current job manually, if i try using
.stop()
it does not do anything.Beta Was this translation helpful? Give feedback.
All reactions