From: Michael Tremer Date: Sat, 25 Oct 2008 16:50:37 +0000 (+0200) Subject: Made an option to select the active hosts by hour. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=205adcfe86d03d9be63486ec42545faef714a8ca;p=ipfire.org.git Made an option to select the active hosts by hour. --- diff --git a/build/builder.py b/build/builder.py index 35778f8e..6b0658c4 100644 --- a/build/builder.py +++ b/build/builder.py @@ -197,13 +197,13 @@ class Builder: def get(self, key): return eval("self.%s.get()" % (key,)) -def getAllBuilders(): +def getAllBuilders(age=0): builders = [] for uuid in os.listdir(config["path"]["db"]): if uuid == "empty.txt": continue builder = Builder(config, uuid) - # If there was no activity since 3 days -> continue... - if (time.time() - builder.state.time()) > 3*24*60*60: - continue + # If there was no activity since "age" days -> continue... + if age and (time.time() - builder.state.time()) > age*24*60*60: + continue builders.append(builder) return builders diff --git a/build/index.py b/build/index.py index 216e0c61..75c800e6 100644 --- a/build/index.py +++ b/build/index.py @@ -231,7 +231,7 @@ class Box: site = Site(config) boxes = [] -for builder in getAllBuilders(): +for builder in getAllBuilders(3): boxes.append(Box(builder)) site(boxes)