Add linting rules
This commit is contained in:
1 parent
75a5a42296
commit
c702003c32
43 files changed
+705
-576
No files matched your search
@@ -41,8 +41,8 @@ function stageDownload(task) {
|
||||
}
|
||||
|
||||
function commit(tasks, callback) {
|
||||
let devices = {};
|
||||
for (let t of tasks) {
|
||||
const devices = {};
|
||||
for (const t of tasks) {
|
||||
devices[t.device] = devices[t.device] || [];
|
||||
devices[t.device].push(t);
|
||||
queueTask(t);
|
||||
@@ -50,19 +50,20 @@ function commit(tasks, callback) {
|
||||
|
||||
return new Promise(resolve => {
|
||||
let counter = 1;
|
||||
for (let [deviceId, tasks2] of Object.entries(devices)) {
|
||||
for (const [deviceId, tasks2] of Object.entries(devices)) {
|
||||
++counter;
|
||||
store
|
||||
.postTasks(deviceId, tasks)
|
||||
.then(connectionRequestStatus => {
|
||||
for (let t of tasks2)
|
||||
for (const t of tasks2) {
|
||||
if (t.status === "pending") t.status = "stale";
|
||||
else if (t.status === "done") queue.delete(t);
|
||||
}
|
||||
callback(deviceId, null, connectionRequestStatus, tasks2);
|
||||
if (--counter === 0) resolve();
|
||||
})
|
||||
.catch(err => {
|
||||
for (let t of tasks2) t.status = "stale";
|
||||
for (const t of tasks2) t.status = "stale";
|
||||
callback(deviceId, err, null, tasks2);
|
||||
if (--counter === 0) resolve();
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user