Set last sync time to start of sync when doing a long running sync.
Signed-off-by: Mark Beamer Jr <markbeamerjr@gmail.com>
This commit is contained in:
parent
162107239b
commit
42bec75ef9
1 changed files with 5 additions and 1 deletions
|
@ -48,6 +48,9 @@ export async function claimSync () {
|
||||||
if (!syncState.LastID) {
|
if (!syncState.LastID) {
|
||||||
syncState.LastID = 0;
|
syncState.LastID = 0;
|
||||||
}
|
}
|
||||||
|
if (!syncState.StartSyncTime || syncState.LastID === 0) {
|
||||||
|
syncState.StartSyncTime = new Date().toISOString().slice(0, 19).replace('T', ' ');
|
||||||
|
}
|
||||||
status.info = 'gettingClaimsToUpdate';
|
status.info = 'gettingClaimsToUpdate';
|
||||||
let finished = false;
|
let finished = false;
|
||||||
let lastID = syncState.LastID;
|
let lastID = syncState.LastID;
|
||||||
|
@ -85,7 +88,8 @@ export async function claimSync () {
|
||||||
if (iteration * BatchSize + BatchSize >= MaxClaimsToProcessPerIteration) {
|
if (iteration * BatchSize + BatchSize >= MaxClaimsToProcessPerIteration) {
|
||||||
syncState.LastID = lastID;
|
syncState.LastID = lastID;
|
||||||
} else {
|
} else {
|
||||||
syncState.LastSyncTime = new Date().toISOString().slice(0, 19).replace('T', ' ');
|
syncState.LastID = 0;
|
||||||
|
syncState.LastSyncTime = syncState.StartSyncTime;
|
||||||
}
|
}
|
||||||
await saveJSON(path.join(appRoot.path, 'syncState.json'), syncState);
|
await saveJSON(path.join(appRoot.path, 'syncState.json'), syncState);
|
||||||
status.info = 'upToDate';
|
status.info = 'upToDate';
|
||||||
|
|
Loading…
Reference in a new issue