Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
proto._writeProperties = function() {
var self = this;
if (self._writePropertiesPending) {
self._writePropertiesWaiting = true;
return;
}
clearTimeout(self._writePropertiesTimeout);
self._writePropertiesPending = true;
fse.outputJson(self._properties, self._cache.properties, function(err) {
self._writePropertiesPending = false;
if (err) {
self._writePropertiesTimeout = setTimeout(self._writeProperties.bind(self), RETRY_INTERVAL);
logger.error(err);
} else {
copyFile(self._properties, self._backupProps, function() {
if (self._writePropertiesWaiting) {
self._writePropertiesWaiting = false;
self._writeProperties();
}
});
}
});
};