workonsh's Issues
File changed during synchronization is not synced
Consider the following: 2 files were changed almost simultaneously - A, then B. File A is large enough.
fswatch
detects that file A is changed and tells us. We find out that file A was changed and start rsync
.
Now, rsync
runs for long enough, and during that files B
and C
are changed too.
After rsync
has finished, we set last_synced
time to the current time (i.e. to the time when rsync
has finished) and find out the next line from fswatch
telling us that file B
is changed, too.
We check current time and find that just a little moment has passed since we did the last sync (as we check synchronization end time, not synchronization start time). So we don't run rsync
.
Now, nothing is changed for a long time. And directories are out of sync: file A
is synchronized but file B
isn't.
This will only be fixed after some other file is changed, which may happen not very soon.
What we should do IMO: if no new changes happen for rsync_interval
seconds but we know about some non-synchronized data then still run rsync
.
This will complicate the code logic, and simple for line in ...
loop won't work in this scenario. But it will avoid having directories unsynchronized for too long.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.