Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'use strict';
const azure = require('azure-storage');
const moment = require('moment');
const asyncEachLimit = require('async/eachLimit');
const TextBase64QueueMessageEncoder = require('azure-storage').QueueMessageEncoder.TextBase64QueueMessageEncoder;
const PRE_NLP_QUEUE = process.env.PRE_NLP_QUEUE;
const DATE_FORMAT = 'MM/DD/YYYY HH:mm';
const ASYNC_QUEUE_LIMIT = 50;
function getAzureQueueService(){
let queueSvc = azure.createQueueService();
queueSvc.messageEncoder = new TextBase64QueueMessageEncoder();
queueSvc.createQueueIfNotExists(PRE_NLP_QUEUE, (error, result, response) => { // eslint-disable-line no-unused-vars
if (error) {
RaiseException(`Unable to create new azure queue ${PRE_NLP_QUEUE}`);
}
});
return queueSvc;
}
function queueSigningRequest(quality: string, commit: string): Promise {
const retryOperations = new azure.ExponentialRetryPolicyFilter();
const queueSvc = azure
.createQueueService(process.env['AZURE_STORAGE_ACCOUNT_2'], process.env['AZURE_STORAGE_ACCESS_KEY_2'])
.withFilter(retryOperations);
queueSvc.messageEncoder = new azure.QueueMessageEncoder.TextBase64QueueMessageEncoder();
const message = `${quality}/${commit}`;
return new Promise((c, e) => queueSvc.createMessage('sign-darwin', message, err => err ? e(err) : c()));
}
function queueSigningRequest(quality, commit) {
var retryOperations = new azure.ExponentialRetryPolicyFilter();
var queueSvc = azure
.createQueueService(process.env['AZURE_STORAGE_ACCOUNT_2'], process.env['AZURE_STORAGE_ACCESS_KEY_2'])
.withFilter(retryOperations);
queueSvc.messageEncoder = new azure.QueueMessageEncoder.TextBase64QueueMessageEncoder();
var message = quality + "/" + commit;
return new Promise(function (c, e) { return queueSvc.createMessage('sign-darwin', message, function (err) { return err ? e(err) : c(); }); });
}
function isBuildSigned(quality, commit) {