]> git.ipfire.org Git - ipfire.org.git/commitdiff
Made an option to select the active hosts by hour.
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 25 Oct 2008 16:50:37 +0000 (18:50 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 25 Oct 2008 16:50:37 +0000 (18:50 +0200)
build/builder.py
build/index.py

index 35778f8eba68e2f6174dcee33e74b823afda13aa..6b0658c494ce2ef64865e82a4b0916d4be0423b0 100644 (file)
@@ -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
index 216e0c61c31e8229f930ac87632efa81ebcd2fa0..75c800e6f0ef75fc06f82bebce92998b170c84cf 100644 (file)
@@ -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)