@willsoto/node-konfig-core
Version:
Core configuration pacakge supporting file, static and environment variables
19 lines • 561 B
JavaScript
import { ConstantBackoff, handleAll, retry } from "cockatiel";
export class Loader {
name = "base";
stopOnFailure;
maxRetries;
retryDelay;
constructor(options) {
this.stopOnFailure = options.stopOnFailure ?? true;
this.maxRetries = options.maxRetries ?? 0;
this.retryDelay = options.retryDelay ?? 0;
}
get retryPolicy() {
return retry(handleAll, {
maxAttempts: this.maxRetries,
backoff: new ConstantBackoff(this.retryDelay),
});
}
}
//# sourceMappingURL=base.js.map