I would suggest creating a class that would take on the role of a resource manager. It could track which character is doing what task regarding resources. It would hold an array of characters and their current resource.
Then before assigning a new task to a character you could check the resource manager if the target resource isn’t already assigned to another character for farming.
A bit of a similar situation is tackled in this video