End plugins before shutdown

This commit is contained in:
Ruud
2012-01-07 22:57:53 +01:00
parent c670a951cb
commit 044a23764d
2 changed files with 9 additions and 2 deletions
+6
View File
@@ -6,6 +6,7 @@ from os.path import dirname
import os
import sys
import subprocess
import time
# Root path
@@ -34,6 +35,8 @@ def start():
subprocess.call(args, env = new_environ)
return os.path.isfile(os.path.join(base_path, 'restart'))
except KeyboardInterrupt, e:
pass
except Exception, e:
log.critical(e)
return 0
@@ -52,4 +55,7 @@ if __name__ == '__main__':
if not restart:
break
from couchpotato.core.event import fireEvent
fireEvent('app.crappy_shutdown', single = True)
time.sleep(1)
sys.exit()