transactions

This commit is contained in:
2018-12-19 16:32:46 +01:00
parent 01acb126a4
commit 4ae5c26754
3 changed files with 44 additions and 12 deletions

2
dist/autoloader.js vendored
View File

@@ -1,4 +1,4 @@
/*Generated on:Wed Dec 19 2018 16:28:51 GMT+0100 (CET)*/
/*Generated on:Wed Dec 19 2018 16:32:45 GMT+0100 (CET)*/
var AutomaticDispose_Branch = "master";
var AutomaticDispose_URL = "https://jf.git.rest/Jomaar/automatic-dispose/raw/branch/";
var da_lss_adis_time = new Date().getTime();

22
dist/autoloaderV2.js vendored
View File

@@ -1,4 +1,4 @@
/*Generated on:Wed Dec 19 2018 16:28:51 GMT+0100 (CET)*/
/*Generated on:Wed Dec 19 2018 16:32:45 GMT+0100 (CET)*/
/*
* Dexie.js - a minimalistic wrapper for IndexedDB
* ===============================================
@@ -18157,6 +18157,8 @@ class AutomaticDispose {
});
})
}
}).catch((err) => {
console.error(err)
});;
}
@@ -18295,9 +18297,11 @@ class AutomaticDispose {
UpdateMissionsToDone(MissionID) {
const self = this;
return self.ADisDB.transaction('rw', [self.ADisDB.ADisMissions], async () => {
return self.ADisDB.ADisMissions.update(MissionID, {
last_check: Math.floor(new Date().getTime() / 1000),
next_check: Math.floor(new Date().getTime() / 1000) + 120
})
}).catch((err) => {
console.error(err)
})
@@ -18311,6 +18315,8 @@ class AutomaticDispose {
}).delete().catch((err) => {
console.error(err)
})
}).catch((err) => {
console.error(err)
})
}
@@ -18370,6 +18376,8 @@ class AutomaticDispose {
});
}
return setTimeout(self.OpenNextMission.bind(self), 1000, Runner);
}).catch((err) => {
console.error(err)
});
}
@@ -18410,8 +18418,8 @@ class AutomaticDispose {
// return tellParent(`console.log('handler:1000:done:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');`); // delete Mission here as completed
// })
// } else {
return self.ADisDB.transaction('r', [self.ADisDB.ADisMissions], () => {
return self.ADSettings().then((setting) => {
return self.ADisDB.transaction('r', [self.ADisDB.ADisMissions], async () => {
return self.ADSettings().then( async (setting) => {
if (setting[self.MyRunnerSettings] === 'true') {
let where = {
@@ -18444,6 +18452,8 @@ class AutomaticDispose {
return tellParent(`console.log('wunsch:2000:done:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');`);
})
}
}).catch((err) => {
console.error(err)
})
// }
}, 500);
@@ -18580,6 +18590,8 @@ class AutomaticDispose {
} else {
tellParent(`console.log('config:1000:update:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');`); // update Mission here as updated or full
}
}).catch((err) => {
console.error(err)
});
} else {
tellParent(`console.log('config:2000:update:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');`); // update Mission here as updated or full
@@ -18611,6 +18623,8 @@ class AutomaticDispose {
self.UpdateMissionsToDone(self.MissionID);
tellParent(`console.log('config:3000:update:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');`); // update Mission here as updated or full
}
}).catch((err) => {
console.error(err)
});;
}
@@ -18680,6 +18694,8 @@ class AutomaticDispose {
});
}, 250);
}).catch((err) => {
console.error(err)
})

View File

@@ -916,6 +916,8 @@ class AutomaticDispose {
});
})
}
}).catch((err) => {
console.error(err)
});;
}
@@ -1054,9 +1056,11 @@ class AutomaticDispose {
UpdateMissionsToDone(MissionID) {
const self = this;
return self.ADisDB.transaction('rw', [self.ADisDB.ADisMissions], async () => {
return self.ADisDB.ADisMissions.update(MissionID, {
last_check: Math.floor(new Date().getTime() / 1000),
next_check: Math.floor(new Date().getTime() / 1000) + 120
})
}).catch((err) => {
console.error(err)
})
@@ -1070,6 +1074,8 @@ class AutomaticDispose {
}).delete().catch((err) => {
console.error(err)
})
}).catch((err) => {
console.error(err)
})
}
@@ -1129,6 +1135,8 @@ class AutomaticDispose {
});
}
return setTimeout(self.OpenNextMission.bind(self), 1000, Runner);
}).catch((err) => {
console.error(err)
});
}
@@ -1169,8 +1177,8 @@ class AutomaticDispose {
// return tellParent(`console.log('handler:1000:done:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');`); // delete Mission here as completed
// })
// } else {
return self.ADisDB.transaction('r', [self.ADisDB.ADisMissions], () => {
return self.ADSettings().then((setting) => {
return self.ADisDB.transaction('r', [self.ADisDB.ADisMissions], async () => {
return self.ADSettings().then( async (setting) => {
if (setting[self.MyRunnerSettings] === 'true') {
let where = {
@@ -1203,6 +1211,8 @@ class AutomaticDispose {
return tellParent(`console.log('wunsch:2000:done:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');`);
})
}
}).catch((err) => {
console.error(err)
})
// }
}, 500);
@@ -1339,6 +1349,8 @@ class AutomaticDispose {
} else {
tellParent(`console.log('config:1000:update:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');`); // update Mission here as updated or full
}
}).catch((err) => {
console.error(err)
});
} else {
tellParent(`console.log('config:2000:update:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');`); // update Mission here as updated or full
@@ -1370,6 +1382,8 @@ class AutomaticDispose {
self.UpdateMissionsToDone(self.MissionID);
tellParent(`console.log('config:3000:update:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');`); // update Mission here as updated or full
}
}).catch((err) => {
console.error(err)
});;
}
@@ -1439,6 +1453,8 @@ class AutomaticDispose {
});
}, 250);
}).catch((err) => {
console.error(err)
})