From a2d22b6feb87fa42937631d2ea1c4eda0874dbb0 Mon Sep 17 00:00:00 2001 From: Ruud Date: Wed, 19 Mar 2014 22:46:14 +0100 Subject: [PATCH] Set cleanup interval --- couchpotato/core/plugins/file.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/couchpotato/core/plugins/file.py b/couchpotato/core/plugins/file.py index 77b3ba8..b2533c0 100644 --- a/couchpotato/core/plugins/file.py +++ b/couchpotato/core/plugins/file.py @@ -4,7 +4,7 @@ import traceback from couchpotato import get_db from couchpotato.api import addApiView -from couchpotato.core.event import addEvent +from couchpotato.core.event import addEvent, fireEvent from couchpotato.core.helpers.encoding import toUnicode from couchpotato.core.helpers.variable import md5, getExt from couchpotato.core.logger import CPLog @@ -32,12 +32,11 @@ class FileManager(Plugin): 'return': {'type': 'file'} }) - addEvent('app.load', self.cleanup) + fireEvent('schedule.interval', 'file.cleanup', self.cleanup, hours = 24) def cleanup(self): # Wait a bit after starting before cleanup - time.sleep(2) log.debug('Cleaning up unused files') try: