Last Sync Problem

Discuss new features and functions
Posts: 12
Joined: 23 Nov 2016

zorvek

When multiple scripts are run synchronously, the status file in AppData is not updated correctly. It appears that each task loads the file and then writes an updated version when that task completes. The problem is that any other task running at the same time that has written it's status before another task writes it's status will have it's status overwritten.

The correct way to update the status file is to wait until the task is completed and then update the file with a file lock but only when it is not locked by another task. The amount of time that the file is open and locked should be kept to a minimum. This should take a small fraction of a second.

An even better solution is to store the status in the registry using the script name as the key. The registry operates like a database and is a much more reasonable solution for this situation.
User avatar
Posts: 2997
Joined: 22 Aug 2012

Plerry

If by "the status file" you mean the GlobalSettings.xml file, you are likely referring to the FreeFileSync (FFS) behavior described as Potential cause 1 in this post.
This is a still unresolved issue in FFS.