Split hydra-queue-runner.cc more

This commit is contained in:
Eelco Dolstra
2015-07-21 15:14:17 +02:00
parent 6ddcd37df1
commit 7e026d35f7
6 changed files with 921 additions and 904 deletions

View File

@@ -118,6 +118,9 @@ struct Step
};
void getDependents(Step::ptr step, std::set<Build::ptr> & builds, std::set<Step::ptr> & steps);
struct Machine
{
typedef std::shared_ptr<Machine> ptr;
@@ -159,6 +162,12 @@ class State
{
private:
// FIXME: Make configurable.
const unsigned int maxTries = 5;
const unsigned int retryInterval = 60; // seconds
const float retryBackoff = 3.0;
const unsigned int maxParallelCopyClosure = 4;
nix::Path hydraData, logDir;
nix::StringSet localPlatforms;
@@ -306,3 +315,10 @@ public:
void run(BuildID buildOne = 0);
};
template <class C, class V>
bool has(const C & c, const V & v)
{
return c.find(v) != c.end();
}