Adapt estimateSequence to replication interval
parent
f2381554f9
commit
e277d8da24
|
@ -5,6 +5,7 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
"math"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
|
@ -209,6 +210,7 @@ func estimateSequence(url string, timestamp time.Time) int {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
behind := state.Time.Sub(timestamp)
|
behind := state.Time.Sub(timestamp)
|
||||||
return state.Sequence - int(behind.Minutes())
|
// Sequence unit depends on replication interval (minute, hour, day).
|
||||||
|
return state.Sequence - int(math.Ceil(behind.Minutes() / config.BaseOptions.ReplicationInterval.Minutes()))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue