Update timestamp on events even if they match
If we don't do this, we don't maintain the invariant that the timestamp of the latest locally-stored event for a path is the last time this path was updated. Not maintaining this invariant can cause to incorrect behavior (i.e. files being deleted when they shouldn't).
This commit is contained in:
parent
793e4eb6b2
commit
d7cd6f348c
@ -236,10 +236,13 @@ func ProcessRemoteEvent(globals AsinkGlobals, event *asink.Event) {
|
|||||||
|
|
||||||
//if we already have this event, or if it is older than our most recent event, bail out
|
//if we already have this event, or if it is older than our most recent event, bail out
|
||||||
if latestLocal != nil {
|
if latestLocal != nil {
|
||||||
if event.Timestamp < latestLocal.Timestamp || event.IsSameEvent(latestLocal) {
|
if event.Timestamp < latestLocal.Timestamp {
|
||||||
event.LocalStatus |= asink.DISCARDED
|
event.LocalStatus |= asink.DISCARDED
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if event.IsSameEvent(latestLocal) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if latestLocal.Hash != event.Predecessor && latestLocal.Hash != event.Hash {
|
if latestLocal.Hash != event.Predecessor && latestLocal.Hash != event.Hash {
|
||||||
fmt.Printf("conflict:\n")
|
fmt.Printf("conflict:\n")
|
||||||
|
Loading…
Reference in New Issue
Block a user