Skip to content

Commit 1b0e66b

Browse files
author
Andy Steed
committed
Fix ci formatting failures
1 parent 4cb0aee commit 1b0e66b

File tree

3 files changed

+42
-41
lines changed

3 files changed

+42
-41
lines changed

action/alarmWebAction.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ function main(params) {
3434
additionalData: common.constructObject(params.additionalData),
3535
};
3636
var triggerID = new Database().constructTriggerID(getDBConfig(params), triggerData);
37-
37+
3838
var workers = params.workers instanceof Array ? params.workers : [];
3939
var deleteAfterFireArray = ['false', 'true', 'rules'];
4040
var db;
@@ -149,7 +149,7 @@ function main(params) {
149149
return getDatabase(getDBConfig(params));
150150
})
151151
.then((database) => {
152-
db = database
152+
db = database;
153153
return db.getWorkerID(workers);
154154
})
155155
.then((worker) => {
@@ -178,7 +178,7 @@ function main(params) {
178178
return getDatabase(getDBConfig(params));
179179
})
180180
.then((database) => {
181-
db = database
181+
db = database;
182182
return db.getTrigger(triggerID);
183183
})
184184
.then(doc => {
@@ -231,7 +231,7 @@ function main(params) {
231231
return getDatabase(getDBConfig(params));
232232
})
233233
.then((database) => {
234-
db = database
234+
db = database;
235235
return db.getTrigger(triggerID);
236236
})
237237
.then(trigger => {
@@ -352,7 +352,7 @@ function main(params) {
352352
return getDatabase(getDBConfig(params));
353353
})
354354
.then((database) => {
355-
db = database
355+
db = database;
356356
return db.getTrigger(triggerID);
357357
})
358358
.then(trigger => {

action/lib/cosmosdb.js

Lines changed: 35 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,29 @@
11
/*
2-
* Licensed to the Apache Software Foundation (ASF) under one or more
3-
* contributor license agreements. See the NOTICE file distributed with
4-
* this work for additional information regarding copyright ownership.
5-
* The ASF licenses this file to You under the Apache License, Version 2.0
6-
* (the "License"); you may not use this file except in compliance with
7-
* the License. You may obtain a copy of the License at
8-
*
9-
* http://www.apache.org/licenses/LICENSE-2.0
10-
*
11-
* Unless required by applicable law or agreed to in writing, software
12-
* distributed under the License is distributed on an "AS IS" BASIS,
13-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14-
* See the License for the specific language governing permissions and
15-
* limitations under the License.
16-
*/
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
1718
const common = require('./common');
1819

1920
module.exports = function(endpoint, masterKey) {
2021
var DocumentClient = require('documentdb').DocumentClient;
2122
var client = new DocumentClient(endpoint, {masterKey: masterKey});
22-
23+
2324
this.client = client;
2425
var utilsDB = this;
25-
26+
2627
this.init = function(databaseName, collectionName) {
2728
console.log("cosmosdb.init");
2829
let querySpec = {
@@ -44,7 +45,7 @@ module.exports = function(endpoint, masterKey) {
4445
});
4546
});
4647
};
47-
48+
4849
//get collection in cosmosdb terminology
4950
this.getDatabase = function(collectionName) {
5051
console.log(`cosmosdb.getDatabase:`, collectionName);
@@ -70,12 +71,12 @@ module.exports = function(endpoint, masterKey) {
7071
utilsDB.collectionLink = results[0]._self;
7172
resolve(results);
7273
}
73-
74+
7475
}
7576
});
7677
});
7778
};
78-
79+
7980
//create collection in cosmosdb terminology
8081
this.createDatabase = function(collectionName) {
8182
console.log(`cosmosdb.createDatabase:`,collectionName);
@@ -93,24 +94,24 @@ module.exports = function(endpoint, masterKey) {
9394
});
9495
});
9596
};
96-
97+
9798
this.getWorkerID = function(availabeWorkers) {
98-
99+
99100
return new Promise((resolve, reject) => {
100101
var workerID = availabeWorkers[0] || 'worker0';
101102
resolve(workerID);
102103
});
103104
};
104-
105+
105106
this.createTrigger = function(triggerID, newTrigger) {
106107
console.log(`cosmosdb.createTrigger:`, triggerID);
107108
if(!newTrigger.id) {
108109
console.log("add id to doc");
109110
newTrigger.id = triggerID;
110111
}
111-
112+
112113
return new Promise(function(resolve, reject) {
113-
114+
114115
client.createDocument(utilsDB.collectionLink, newTrigger, function(err, document) {
115116
if(err) {
116117
console.error(`cosmosdb.createTrigger failed:`, err);
@@ -122,15 +123,15 @@ module.exports = function(endpoint, masterKey) {
122123
});
123124
});
124125
};
125-
126+
126127
this.getTrigger = function(triggerID, retry = true) {
127128
console.log(`cosmosdb.getTrigger:`, triggerID);
128129
return new Promise(function(resolve, reject) {
129130
let querySpec = {
130131
query: 'SELECT * FROM root r WHERE r.id = @id',
131132
parameters: [{ name: '@id', value: triggerID }]
132133
};
133-
134+
134135
client.queryDocuments(utilsDB.collectionLink, querySpec).toArray(function(err, results) {
135136
if (err) {
136137
if (retry) {
@@ -145,7 +146,7 @@ module.exports = function(endpoint, masterKey) {
145146
reject(common.sendError(err.statusCode, 'could not find trigger ' + triggerID + ' in the database'));
146147
}
147148
}
148-
149+
149150
if(results.length == 0)
150151
resolve();
151152
else {
@@ -155,7 +156,7 @@ module.exports = function(endpoint, masterKey) {
155156
});
156157
});
157158
};
158-
159+
159160
this.updateTrigger = function(triggerID, trigger, params, retryCount) {
160161
console.log(`cosmosdb.updateTrigger:`, triggerID);
161162
if (retryCount === 0) {
@@ -168,7 +169,7 @@ module.exports = function(endpoint, masterKey) {
168169
};
169170
trigger.status = status;
170171
}
171-
172+
172173
return new Promise(function(resolve, reject) {
173174
utilsDB.getTrigger(triggerID)
174175
.then((doc) => {
@@ -197,15 +198,15 @@ module.exports = function(endpoint, masterKey) {
197198
});
198199
});
199200
};
200-
201+
201202
this.disableTrigger = function(triggerID, trigger, retryCount, crudMessage) {
202203
console.log(`cosmosdb.disableTrigger:`, triggerID);
203204
if (retryCount === 0) {
204205
//check if it is already disabled
205206
if (trigger.status && trigger.status.active === false) {
206207
return Promise.resolve(triggerID);
207208
}
208-
209+
209210
var message = `Automatically disabled trigger while ${crudMessage}`;
210211
var status = {
211212
'active': false,
@@ -214,10 +215,10 @@ module.exports = function(endpoint, masterKey) {
214215
};
215216
trigger.status = status;
216217
}
217-
218+
218219
return utilsDB.updateTrigger(triggerID, trigger, {}, retryCount);
219220
};
220-
221+
221222
this.deleteTrigger = function(triggerID) {
222223
console.log(`cosmosdb.deleteTrigger`, triggerID);
223224
return new Promise(function(resolve, reject) {

provider/lib/utils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ module.exports = function(logger, triggerDB, redisClient) {
323323
logger.error(method, 'trigger', triggerIdentifier, 'has been disabled due to status code:', response.statusCode);
324324
}
325325
else {
326-
logger.info(method, 'will create trigger')
326+
logger.info(method, 'will create trigger');
327327
createTrigger(triggerIdentifier, doc)
328328
.then(cachedTrigger => {
329329
self.triggers[triggerIdentifier] = cachedTrigger;
@@ -350,7 +350,7 @@ module.exports = function(logger, triggerDB, redisClient) {
350350
logger.error(method, 'could not get latest state from database', err);
351351
});
352352
};
353-
353+
354354
function setupFollow(seq) {
355355
var method = 'setupFollow';
356356

0 commit comments

Comments
 (0)