Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
MoesifConfigManager.prototype.tryGetConfig = function () {
if (!this._loadingConfig && this.shouldFetchConfig()) {
// only send one config request at a time
this._loadingConfig = true;
var that = this;
moesifController.getAppConfig(function (_, __, event) {
that._loadingConfig = false;
if (event && event.response.statusCode === 200) {
that._configHash = event.response.headers[HASH_HEADER];
try {
that._config = JSON.parse(event.response.body);
that._lastConfigUpdate = now();
} catch (e) {
console.warn('moesif-express: error parsing config');
}
}
});
}
};