Replies: 1 comment 1 reply
-
Can you please provide some more information? I understand that your load balancer directs the initial request that triggers a job to a specific instance, and that particular instance handles the job. Later the clean up routine running as background task, can be picked up by any instances. Your problem is that the clean up routing is picked by each instance? Did you consider maybe adding a messaging system, for example Rabbit MQ, to write a message about a clean-up task, and use the SDK of the messaging system to have a single consumer handle the task at a time? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I would like to seek inputs related to background tasks. We run multiple instances of the application in K8s and route the requests using a load balancer. We have defined some clean up routine as a background task in the application. However, each instance of an application will trigger the same task in background which is completely unnecessary.
Is there any thoughts around how to restrict the task to a specific instance?
Beta Was this translation helpful? Give feedback.
All reactions