From 205adcfe86d03d9be63486ec42545faef714a8ca Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sat, 25 Oct 2008 18:50:37 +0200 Subject: [PATCH] Made an option to select the active hosts by hour. --- build/builder.py | 8 ++++---- build/index.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) 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) -- 2.47.3