Browse Source

Set cleanup interval

pull/2993/head
Ruud 11 years ago
parent
commit
a2d22b6feb
  1. 5
      couchpotato/core/plugins/file.py

5
couchpotato/core/plugins/file.py

@ -4,7 +4,7 @@ import traceback
from couchpotato import get_db from couchpotato import get_db
from couchpotato.api import addApiView 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.encoding import toUnicode
from couchpotato.core.helpers.variable import md5, getExt from couchpotato.core.helpers.variable import md5, getExt
from couchpotato.core.logger import CPLog from couchpotato.core.logger import CPLog
@ -32,12 +32,11 @@ class FileManager(Plugin):
'return': {'type': 'file'} 'return': {'type': 'file'}
}) })
addEvent('app.load', self.cleanup) fireEvent('schedule.interval', 'file.cleanup', self.cleanup, hours = 24)
def cleanup(self): def cleanup(self):
# Wait a bit after starting before cleanup # Wait a bit after starting before cleanup
time.sleep(2)
log.debug('Cleaning up unused files') log.debug('Cleaning up unused files')
try: try:

Loading…
Cancel
Save