* 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)
| 187 | * @returns {undefined} |
| 188 | */ |
| 189 | function 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 | |
| 211 | function applyAndSaveOverlay(overlay, log) { |
| 212 | patchConfiguration(overlay, log, err => { |
no outgoing calls
no test coverage detected