Bug 1359604 - Enable the ESLint recommended rules for taskcluster/docker/index-task/. r=dustin

MozReview-Commit-ID: EOX2SvofSS5
This commit is contained in:
Mark Banner
2017-04-25 21:54:13 +01:00
parent d23f4d1909
commit f40a0e536c
2 changed files with 23 additions and 8 deletions

View File

@@ -1,10 +1,10 @@
let taskcluster = require('taskcluster-client');
let taskcluster = require("taskcluster-client");
// Create instance of index client
let index = new taskcluster.Index({
delayFactor: 750, // Good solid delay for background process
retries: 8, // A few extra retries for robustness
baseUrl: 'taskcluster/index/v1',
baseUrl: "taskcluster/index/v1",
});
// Create queue instance for fetching taskId
@@ -19,14 +19,14 @@ let namespaces = process.argv.slice(2);
// Validate input
if (!taskId) {
console.log('Expected target task as environment variable: TARGET_TASKID');
console.log("Expected target task as environment variable: TARGET_TASKID");
process.exit(1);
}
// Fetch task definition to get expiration and then insert into index
queue.task(taskId).then(task => task.expires).then(expires => {
return Promise.all(namespaces.map(namespace => {
console.log('Inserting %s into index under: %s', taskId, namespace);
console.log("Inserting %s into index under: %s", taskId, namespace);
return index.insertTask(namespace, {
taskId,
rank: 0,
@@ -35,13 +35,13 @@ queue.task(taskId).then(task => task.expires).then(expires => {
});
}));
}).then(() => {
console.log('indexing successfully completed.');
console.log("indexing successfully completed.");
process.exit(0);
}).catch(err => {
console.log('Error:\n%s', err);
console.log("Error:\n%s", err);
if (err.stack) {
console.log('Stack:\n%s', err.stack);
console.log("Stack:\n%s", err.stack);
}
console.log('Properties:\n%j', err);
console.log("Properties:\n%j", err);
throw err;
}).catch(() => process.exit(1));