parent
b7203e853e
commit
42c5774e78
|
@ -123,6 +123,8 @@ public:
|
||||||
|
|
||||||
std::shared_ptr<std::string> getBuildLog(const Path & path) override;
|
std::shared_ptr<std::string> getBuildLog(const Path & path) override;
|
||||||
|
|
||||||
|
int getPriority() override { return priority; }
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -812,6 +812,10 @@ std::list<ref<Store>> getDefaultSubstituters()
|
||||||
for (auto uri : settings.extraSubstituters.get())
|
for (auto uri : settings.extraSubstituters.get())
|
||||||
addStore(uri);
|
addStore(uri);
|
||||||
|
|
||||||
|
stores.sort([](ref<Store> & a, ref<Store> & b) {
|
||||||
|
return a->getPriority() < b->getPriority();
|
||||||
|
});
|
||||||
|
|
||||||
return stores;
|
return stores;
|
||||||
} ());
|
} ());
|
||||||
|
|
||||||
|
|
|
@ -590,6 +590,11 @@ public:
|
||||||
a notion of connection. Otherwise this is a no-op. */
|
a notion of connection. Otherwise this is a no-op. */
|
||||||
virtual void connect() { };
|
virtual void connect() { };
|
||||||
|
|
||||||
|
/* Get the priority of the store, used to order substituters. In
|
||||||
|
particular, binary caches can specify a priority field in their
|
||||||
|
"nix-cache-info" file. Lower value means higher priority. */
|
||||||
|
virtual int getPriority() { return 0; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
Stats stats;
|
Stats stats;
|
||||||
|
|
Loading…
Reference in a new issue