Shedlock to pick certain servers only

234 Views Asked by At

I have implemented shedlock for my application which works fine without any issues for the two servers we have.

We now have two new servers added on a different domain, and the shedlock picks them as well. (Well, that's how its intended to be)

I have a job which creates the pdf files and place it in a folder. The new servers added don't have access to these folders. So, my job fails when the job is picked by these two new servers.

Is it possible to tell shedlock to pick from any one of my two servers or not pick the other two?

1

There are 1 best solutions below

0
On

First of all, ShedLock only provides scheduler locking, scheduling itself is done by some other library, I will assume that you are using Spring. So the question should be, how do I switch-off Spring scheduler on certain nodes. One possible way is described here https://stackoverflow.com/a/18406954/277042