MCPcopy Create free account
hub / github.com/CloudBoost/cloudboost / getSettingsVariables

Function getSettingsVariables

database-connect/keyService.js:39–58  ·  view source on GitHub ↗
(dbc)

Source from the content-addressed store, hash-verified

37module.exports = {
38
39 async getSettingsVariables(dbc) {
40 const deferred = q.defer();
41 const collection = dbc.db(config.globalDb).collection(config.globalSettings);
42 try {
43 const docs = await collection.find({}).toArray();
44 if (docs.length) {
45 deferred.resolve(docs[0]);
46 } else {
47 throw 'No configuration found.';
48 }
49 } catch (error) {
50 winston.error({
51 error: String(error),
52 stack: new Error().stack,
53 });
54 deferred.reject(error);
55 }
56
57 return deferred.promise;
58 },
59
60 async initSettingsVariable(dbc) {
61 const deferred = q.defer();

Callers

nothing calls this directly

Calls 1

findMethod · 0.80

Tested by

no test coverage detected