mirror of
https://github.com/theodore-song/polymarket-analyst.git
synced 2026-08-17 09:38:06 +00:00
Prefer richer synced state
This commit is contained in:
+1
-4
@@ -596,10 +596,7 @@ function cloudShouldReplaceLocal(cloud,local){
|
|||||||
const remote=stateFromSyncItems(cloud&&cloud.items);
|
const remote=stateFromSyncItems(cloud&&cloud.items);
|
||||||
if(!remote)return false;
|
if(!remote)return false;
|
||||||
const remoteDepth=stateDepth(remote), localDepth=stateDepth(local);
|
const remoteDepth=stateDepth(remote), localDepth=stateDepth(local);
|
||||||
if(remoteDepth!==localDepth)return remoteDepth>localDepth;
|
return remoteDepth>localDepth;
|
||||||
const remoteTime=Date.parse(remote.last_run||cloud.updated_at||0)||0;
|
|
||||||
const localTime=Date.parse(local&&local.last_run||0)||0;
|
|
||||||
return remoteTime>localTime;
|
|
||||||
}
|
}
|
||||||
async function pushCloudState(){
|
async function pushCloudState(){
|
||||||
try{
|
try{
|
||||||
|
|||||||
Reference in New Issue
Block a user