diff --git a/src/libstore/globals.hh b/src/libstore/globals.hh index 3dcf3d4791d..9ecbb962360 100644 --- a/src/libstore/globals.hh +++ b/src/libstore/globals.hh @@ -515,6 +515,10 @@ public: this, true, "enforce-determinism", "Whether to fail if repeated builds produce different output. See `repeat`."}; + Setting substituterDisableTime{ + this, 60, "substituter-disable-time", + "How long to disable substituters on fail"}; + Setting trustedPublicKeys{ this, {"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="}, diff --git a/src/libstore/http-binary-cache-store.cc b/src/libstore/http-binary-cache-store.cc index 73bcd6e817d..25b1191bbb5 100644 --- a/src/libstore/http-binary-cache-store.cc +++ b/src/libstore/http-binary-cache-store.cc @@ -83,7 +83,7 @@ class HttpBinaryCacheStore : public virtual HttpBinaryCacheStoreConfig, public v { auto state(_state.lock()); if (state->enabled && settings.tryFallback) { - int t = 60; + int t = settings.substituterDisableTime; printError("disabling binary cache '%s' for %s seconds", getUri(), t); state->enabled = false; state->disabledUntil = std::chrono::steady_clock::now() + std::chrono::seconds(t);