MCPcopy Index your code
hub / github.com/scality/cloudserver / loadCachedOverlay

Function loadCachedOverlay

lib/management/configuration.js:189–209  ·  view source on GitHub ↗

* Loads the latest cached configuration overlay from the management * database, without contacting the Orbit API. * * @param {werelogs~Logger} log Request-scoped logger * @param {function} callback Function called with (error, cachedOverlay) * * @returns {undefined}

(log, callback)

Source from the content-addressed store, hash-verified

187 * @returns {undefined}
188 */
189function loadCachedOverlay(log, callback) {
190 return metadata.getObjectMD(managementDatabaseName,
191 latestOverlayVersionKey, {}, log, (err, version) => {
192 if (err) {
193 if (err.is.NoSuchKey) {
194 return process.nextTick(callback, null, {});
195 }
196 return callback(err);
197 }
198 return metadata.getObjectMD(managementDatabaseName,
199 `configuration/overlay/${version}`, {}, log, (err, conf) => {
200 if (err) {
201 if (err.is.NoSuchKey) {
202 return process.nextTick(callback, null, {});
203 }
204 return callback(err);
205 }
206 return callback(null, conf);
207 });
208 });
209}
210
211function applyAndSaveOverlay(overlay, log) {
212 patchConfiguration(overlay, log, err => {

Callers 2

initManagementFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected