Concurrent access to files

Talk, speculate, discuss, pontificate. As long as it pertains to Hazel.

Moderators: Mr_Noodle, Moderators

Concurrent access to files Wed Jan 25, 2017 5:25 am • by nobsi
Hi,

I'm looking for a best practice on how to handle concurrent access to a file. Following scenario: A 3rd-party app pushes a file to Dropbox. Two Macs begin syncing the file and on both Hazel watches the folder. What I want to achieve is that only one (the first who grabs the file) processes the file.

I thought of something like a rename-waituntilsync-recheck routine.

Do you have any ideas or has someone already solved such a scenario?

Thank you and best regards,
Richard
nobsi
 
Posts: 6
Joined: Wed Jan 25, 2017 4:59 am

Re: Concurrent access to files Wed Jan 25, 2017 2:05 pm • by Mr_Noodle
I'd recommend against having Hazel on two machines processing the same set of files. It's best to have just one instance. Otherwise, you will have all sorts of issues with concurrency which will be very hard to handle.
Mr_Noodle
Site Admin
 
Posts: 11230
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Open Discussion