transactions
This commit is contained in:
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
/*Generated on:Wed Dec 19 2018 16:24:02 GMT+0100 (CET)*/
|
/*Generated on:Wed Dec 19 2018 16:28:51 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();
|
||||||
|
|||||||
Vendored
+12
-11
@@ -1,4 +1,4 @@
|
|||||||
/*Generated on:Wed Dec 19 2018 16:24:02 GMT+0100 (CET)*/
|
/*Generated on:Wed Dec 19 2018 16:28:51 GMT+0100 (CET)*/
|
||||||
/*
|
/*
|
||||||
* Dexie.js - a minimalistic wrapper for IndexedDB
|
* Dexie.js - a minimalistic wrapper for IndexedDB
|
||||||
* ===============================================
|
* ===============================================
|
||||||
@@ -18126,10 +18126,10 @@ class AutomaticDispose {
|
|||||||
ReadAndAddMissions(MissionID, Runner) {
|
ReadAndAddMissions(MissionID, Runner) {
|
||||||
const self = this;
|
const self = this;
|
||||||
|
|
||||||
return self.ADisDB.transaction('rw', [self.ADisDB.ADisMissions, self.ADisDB.ADisAvailabelMissions], () => {
|
return self.ADisDB.transaction('r', [self.ADisDB.ADisMissions], async () => {
|
||||||
|
return self.ADSettings().then(async () => {
|
||||||
self.ADSettings().then(() => {
|
|
||||||
return self.ADisDB.ADisMissions.toCollection()
|
return self.ADisDB.ADisMissions.toCollection()
|
||||||
|
})
|
||||||
}).then((Missions) => {
|
}).then((Missions) => {
|
||||||
if (typeof Missions !== "undefined") {
|
if (typeof Missions !== "undefined") {
|
||||||
return Missions.count((count) => {
|
return Missions.count((count) => {
|
||||||
@@ -18157,8 +18157,7 @@ class AutomaticDispose {
|
|||||||
});
|
});
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
});
|
});;
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
AddMission(ID, Runner) {
|
AddMission(ID, Runner) {
|
||||||
@@ -18306,11 +18305,13 @@ class AutomaticDispose {
|
|||||||
|
|
||||||
RemoveMissionsFromQueue(MissionID) {
|
RemoveMissionsFromQueue(MissionID) {
|
||||||
const self = this;
|
const self = this;
|
||||||
|
return self.ADisDB.transaction('rw', [self.ADisDB.ADisMissions], async () => {
|
||||||
return self.ADisDB.ADisMissions.where({
|
return self.ADisDB.ADisMissions.where({
|
||||||
missionID: MissionID
|
missionID: MissionID
|
||||||
}).delete().catch((err) => {
|
}).delete().catch((err) => {
|
||||||
console.error(err)
|
console.error(err)
|
||||||
})
|
})
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
OpenNextMission(Runner) {
|
OpenNextMission(Runner) {
|
||||||
@@ -18329,7 +18330,7 @@ class AutomaticDispose {
|
|||||||
// })
|
// })
|
||||||
|
|
||||||
return self.ADisDB.transaction('rw', [self.ADisDB.ADisMissions, self.ADisDB.ADisAvailabelMissions], () => {
|
return self.ADisDB.transaction('rw', [self.ADisDB.ADisMissions, self.ADisDB.ADisAvailabelMissions], () => {
|
||||||
self.ADSettings().then((setting) => {
|
return self.ADSettings().then((setting) => {
|
||||||
if (setting[runnerSettings] == 'true') {
|
if (setting[runnerSettings] == 'true') {
|
||||||
return self.ADisDB.ADisMissions.where({
|
return self.ADisDB.ADisMissions.where({
|
||||||
runner: Runner,
|
runner: Runner,
|
||||||
@@ -18339,6 +18340,7 @@ class AutomaticDispose {
|
|||||||
return item.next_check <= Math.floor(new Date().getTime() / 1000)
|
return item.next_check <= Math.floor(new Date().getTime() / 1000)
|
||||||
}).limit(1)
|
}).limit(1)
|
||||||
}
|
}
|
||||||
|
})
|
||||||
}).then((Wunsch) => {
|
}).then((Wunsch) => {
|
||||||
// console.table(Wunsch);
|
// console.table(Wunsch);
|
||||||
if (Wunsch !== undefined) {
|
if (Wunsch !== undefined) {
|
||||||
@@ -18369,7 +18371,6 @@ class AutomaticDispose {
|
|||||||
}
|
}
|
||||||
return setTimeout(self.OpenNextMission.bind(self), 1000, Runner);
|
return setTimeout(self.OpenNextMission.bind(self), 1000, Runner);
|
||||||
});
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// - -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
|
// - -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
|
||||||
@@ -18409,8 +18410,8 @@ class AutomaticDispose {
|
|||||||
// return tellParent(`console.log('handler:1000:done:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');`); // delete Mission here as completed
|
// return tellParent(`console.log('handler:1000:done:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');`); // delete Mission here as completed
|
||||||
// })
|
// })
|
||||||
// } else {
|
// } else {
|
||||||
return self.ADisDB.transaction('rw', [self.ADisDB.ADisMissions], () => {
|
return self.ADisDB.transaction('r', [self.ADisDB.ADisMissions], () => {
|
||||||
self.ADSettings().then((setting) => {
|
return self.ADSettings().then((setting) => {
|
||||||
if (setting[self.MyRunnerSettings] === 'true') {
|
if (setting[self.MyRunnerSettings] === 'true') {
|
||||||
|
|
||||||
let where = {
|
let where = {
|
||||||
@@ -18423,6 +18424,7 @@ class AutomaticDispose {
|
|||||||
return item.next_check <= Math.floor(new Date().getTime() / 1000)
|
return item.next_check <= Math.floor(new Date().getTime() / 1000)
|
||||||
}).limit(1)
|
}).limit(1)
|
||||||
}
|
}
|
||||||
|
})
|
||||||
}).then((Wunsch) => {
|
}).then((Wunsch) => {
|
||||||
if (Wunsch !== undefined) {
|
if (Wunsch !== undefined) {
|
||||||
return Wunsch.count(function (count) {
|
return Wunsch.count(function (count) {
|
||||||
@@ -18443,7 +18445,6 @@ class AutomaticDispose {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
|
||||||
// }
|
// }
|
||||||
}, 500);
|
}, 500);
|
||||||
}
|
}
|
||||||
|
|||||||
+11
-10
@@ -885,10 +885,10 @@ class AutomaticDispose {
|
|||||||
ReadAndAddMissions(MissionID, Runner) {
|
ReadAndAddMissions(MissionID, Runner) {
|
||||||
const self = this;
|
const self = this;
|
||||||
|
|
||||||
return self.ADisDB.transaction('rw', [self.ADisDB.ADisMissions, self.ADisDB.ADisAvailabelMissions], () => {
|
return self.ADisDB.transaction('r', [self.ADisDB.ADisMissions], async () => {
|
||||||
|
return self.ADSettings().then(async () => {
|
||||||
self.ADSettings().then(() => {
|
|
||||||
return self.ADisDB.ADisMissions.toCollection()
|
return self.ADisDB.ADisMissions.toCollection()
|
||||||
|
})
|
||||||
}).then((Missions) => {
|
}).then((Missions) => {
|
||||||
if (typeof Missions !== "undefined") {
|
if (typeof Missions !== "undefined") {
|
||||||
return Missions.count((count) => {
|
return Missions.count((count) => {
|
||||||
@@ -916,8 +916,7 @@ class AutomaticDispose {
|
|||||||
});
|
});
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
});
|
});;
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
AddMission(ID, Runner) {
|
AddMission(ID, Runner) {
|
||||||
@@ -1065,11 +1064,13 @@ class AutomaticDispose {
|
|||||||
|
|
||||||
RemoveMissionsFromQueue(MissionID) {
|
RemoveMissionsFromQueue(MissionID) {
|
||||||
const self = this;
|
const self = this;
|
||||||
|
return self.ADisDB.transaction('rw', [self.ADisDB.ADisMissions], async () => {
|
||||||
return self.ADisDB.ADisMissions.where({
|
return self.ADisDB.ADisMissions.where({
|
||||||
missionID: MissionID
|
missionID: MissionID
|
||||||
}).delete().catch((err) => {
|
}).delete().catch((err) => {
|
||||||
console.error(err)
|
console.error(err)
|
||||||
})
|
})
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
OpenNextMission(Runner) {
|
OpenNextMission(Runner) {
|
||||||
@@ -1088,7 +1089,7 @@ class AutomaticDispose {
|
|||||||
// })
|
// })
|
||||||
|
|
||||||
return self.ADisDB.transaction('rw', [self.ADisDB.ADisMissions, self.ADisDB.ADisAvailabelMissions], () => {
|
return self.ADisDB.transaction('rw', [self.ADisDB.ADisMissions, self.ADisDB.ADisAvailabelMissions], () => {
|
||||||
self.ADSettings().then((setting) => {
|
return self.ADSettings().then((setting) => {
|
||||||
if (setting[runnerSettings] == 'true') {
|
if (setting[runnerSettings] == 'true') {
|
||||||
return self.ADisDB.ADisMissions.where({
|
return self.ADisDB.ADisMissions.where({
|
||||||
runner: Runner,
|
runner: Runner,
|
||||||
@@ -1098,6 +1099,7 @@ class AutomaticDispose {
|
|||||||
return item.next_check <= Math.floor(new Date().getTime() / 1000)
|
return item.next_check <= Math.floor(new Date().getTime() / 1000)
|
||||||
}).limit(1)
|
}).limit(1)
|
||||||
}
|
}
|
||||||
|
})
|
||||||
}).then((Wunsch) => {
|
}).then((Wunsch) => {
|
||||||
// console.table(Wunsch);
|
// console.table(Wunsch);
|
||||||
if (Wunsch !== undefined) {
|
if (Wunsch !== undefined) {
|
||||||
@@ -1128,7 +1130,6 @@ class AutomaticDispose {
|
|||||||
}
|
}
|
||||||
return setTimeout(self.OpenNextMission.bind(self), 1000, Runner);
|
return setTimeout(self.OpenNextMission.bind(self), 1000, Runner);
|
||||||
});
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// - -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
|
// - -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
|
||||||
@@ -1168,8 +1169,8 @@ class AutomaticDispose {
|
|||||||
// return tellParent(`console.log('handler:1000:done:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');`); // delete Mission here as completed
|
// return tellParent(`console.log('handler:1000:done:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');`); // delete Mission here as completed
|
||||||
// })
|
// })
|
||||||
// } else {
|
// } else {
|
||||||
return self.ADisDB.transaction('rw', [self.ADisDB.ADisMissions], () => {
|
return self.ADisDB.transaction('r', [self.ADisDB.ADisMissions], () => {
|
||||||
self.ADSettings().then((setting) => {
|
return self.ADSettings().then((setting) => {
|
||||||
if (setting[self.MyRunnerSettings] === 'true') {
|
if (setting[self.MyRunnerSettings] === 'true') {
|
||||||
|
|
||||||
let where = {
|
let where = {
|
||||||
@@ -1182,6 +1183,7 @@ class AutomaticDispose {
|
|||||||
return item.next_check <= Math.floor(new Date().getTime() / 1000)
|
return item.next_check <= Math.floor(new Date().getTime() / 1000)
|
||||||
}).limit(1)
|
}).limit(1)
|
||||||
}
|
}
|
||||||
|
})
|
||||||
}).then((Wunsch) => {
|
}).then((Wunsch) => {
|
||||||
if (Wunsch !== undefined) {
|
if (Wunsch !== undefined) {
|
||||||
return Wunsch.count(function (count) {
|
return Wunsch.count(function (count) {
|
||||||
@@ -1202,7 +1204,6 @@ class AutomaticDispose {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
|
||||||
// }
|
// }
|
||||||
}, 500);
|
}, 500);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user