]> git.ipfire.org Git - people/jschlag/pbs.git/commitdiff
Regularly cleanup files
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 8 Oct 2017 14:00:05 +0000 (15:00 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 8 Oct 2017 14:00:05 +0000 (15:00 +0100)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/crontab/pakfire-build-service
src/manager/__init__.py
src/scripts/pakfire-build-service

index 84b598d2e88d3e3e4ee20a0140f98dbd4335728a..602de7e7cfc18a9786bc109f96e31e6159c23301 100644 (file)
@@ -4,6 +4,9 @@
 # Send updates to Bugzilla
 */5 * * * *    nobody  pakfire-build-service send-bug-updates &>/dev/null
 
+# Cleanup files
+*/5 * * * *    nobody  pakfire-build-service cleanup-files &>/dev/null
+
 # Cleanup timed-out uploads
 0 */6 * * *    nobody  pakfire-build-service cleanup-uploads &>/dev/null
 
index d59e557d3ab6e1f099ac6e8a252ab4f8a926e8dc..096e26a55ad7aad352f0c71bc9c00fb7cd4ffdc1 100644 (file)
@@ -1,25 +1,6 @@
 #!/usr/bin/python
 
-from . import base
-
 from .builds       import BuildsFailedRestartEvent, CheckBuildDependenciesEvent
 from .builds       import CreateTestBuildsEvent, DistEvent
 from .repositories import RepositoriesUpdateEvent
 from .sources      import SourcesPullEvent
-
-
-# Events that do not fit anywhere else.
-
-class CleanupFilesEvent(base.Event):
-       """
-               Removes all files that are not needed anymore.
-               (scratch builds, logs, etc.)
-       """
-       # Run once in 5 minutes.
-       interval = 300
-
-       # Intermediate priority.
-       priority = 5
-
-       def run(self):
-               self.pakfire.cleanup_files()
index 20c93e6470f58d01cbbe65b12783b39dae392e8f..7b39ef4bdd44fd61e38434164c6cbe16b849d0f4 100644 (file)
@@ -17,6 +17,9 @@ class Cli(object):
                        # Run mirror check
                        "check-mirrors"    : self.backend.mirrors.check,
 
+                       # Cleanup files
+                       "cleanup-files" : self.backend.cleanup_files,
+
                        # Cleanup sessions
                        "cleanup-sessions" : self.backend.sessions.cleanup,