v2 up ioago94it0a

This commit is contained in:
2018-12-03 20:20:03 +01:00
parent b9b7e70d87
commit a7354d622d
4 changed files with 71 additions and 60 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
/*Generated on:Mon Dec 03 2018 15:48:33 GMT+0100 (CET)*/ /*Generated on:Mon Dec 03 2018 20:20:02 GMT+0100 (CET)*/
var AutomaticDispose_Branch = "master"; var AutomaticDispose_Branch = "master";
var AutomaticDispose_URL = "https://jf.git.rest/Jomaar/automatic-dispose/raw/branch/"; var AutomaticDispose_URL = "https://jf.git.rest/Jomaar/automatic-dispose/raw/branch/";
var da_lss_adis_time = new Date().getTime(); var da_lss_adis_time = new Date().getTime();
+10 -14
View File
@@ -1,4 +1,4 @@
/*Generated on:Mon Dec 03 2018 15:48:33 GMT+0100 (CET)*/ /*Generated on:Mon Dec 03 2018 20:20:02 GMT+0100 (CET)*/
/* /*
* Dexie.js - a minimalistic wrapper for IndexedDB * Dexie.js - a minimalistic wrapper for IndexedDB
* =============================================== * ===============================================
@@ -18647,14 +18647,15 @@ class AutomaticDispose {
done: 'false' done: 'false'
}).and(function (item) { }).and(function (item) {
return item.next_check <= Math.floor(new Date().getTime() / 1000) return item.next_check <= Math.floor(new Date().getTime() / 1000)
}).limit(1) }).toArray()
} }
}).then((Wunsch) => { }).then((Wunsche) => {
// console.table(Wunsch); Wunsche.sort((a, b) => {
if (Wunsch !== undefined) { return a.next_check - b.next_check;
return Wunsch.count(function (count) { });
if (count > 0) { // console.table(Wunsche);
return Wunsch.each((myWunsch) => { if (Wunsche.length > 0) {
let myWunsch = Wunsche[0];
// console.log("MYWUNSCH:") // console.log("MYWUNSCH:")
// console.table(myWunsch); // console.table(myWunsch);
let MissionID = myWunsch.missionID; let MissionID = myWunsch.missionID;
@@ -18671,13 +18672,8 @@ class AutomaticDispose {
// only while // only while
// setTimeout(self.OpenNextMission.bind(self), 5000, Runner); // setTimeout(self.OpenNextMission.bind(self), 5000, Runner);
} }
});
} else {
return setTimeout(self.OpenNextMission.bind(self), 5000, Runner);
} }
}); return setTimeout(self.OpenNextMission.bind(self), 1000, Runner);
}
return setTimeout(self.OpenNextMission.bind(self), 5000, Runner);
}); });
}); });
} }
+9 -13
View File
@@ -1055,14 +1055,15 @@ class AutomaticDispose {
done: 'false' done: 'false'
}).and(function (item) { }).and(function (item) {
return item.next_check <= Math.floor(new Date().getTime() / 1000) return item.next_check <= Math.floor(new Date().getTime() / 1000)
}).limit(1) }).toArray()
} }
}).then((Wunsch) => { }).then((Wunsche) => {
// console.table(Wunsch); Wunsche.sort((a, b) => {
if (Wunsch !== undefined) { return a.next_check - b.next_check;
return Wunsch.count(function (count) { });
if (count > 0) { // console.table(Wunsche);
return Wunsch.each((myWunsch) => { if (Wunsche.length > 0) {
let myWunsch = Wunsche[0];
// console.log("MYWUNSCH:") // console.log("MYWUNSCH:")
// console.table(myWunsch); // console.table(myWunsch);
let MissionID = myWunsch.missionID; let MissionID = myWunsch.missionID;
@@ -1079,13 +1080,8 @@ class AutomaticDispose {
// only while // only while
// setTimeout(self.OpenNextMission.bind(self), 5000, Runner); // setTimeout(self.OpenNextMission.bind(self), 5000, Runner);
} }
});
} else {
return setTimeout(self.OpenNextMission.bind(self), 5000, Runner);
} }
}); return setTimeout(self.OpenNextMission.bind(self), 1000, Runner);
}
return setTimeout(self.OpenNextMission.bind(self), 5000, Runner);
}); });
}); });
} }
+19
View File
@@ -0,0 +1,19 @@
(() => {
let msis = (async () => {
return await AutomaticDisposeCall.ADisDB.ADisMissions.where({
runner: 'om',
available: 'true',
done: 'false'
}).and(function (item) {
return item.next_check <= Math.floor(new Date().getTime() / 1000)
}).toArray()
})();
msis.then((result) => {
result.sort((a, b) => {
return a.next_check > b.next_check;
});
return result;
}).then((sortedResult) => {
console.table(sortedResult);
});
})();