Silent exit of cron and worker with keyboard
This commit is contained in:
1 parent
e77255d0c1
commit
02bbbc6549
2 files changed
+10
-4
No files matched your search
@@ -30,5 +30,8 @@ import trytond.cron as cron
|
||||
from trytond.pool import Pool
|
||||
|
||||
with commandline.pidfile(options):
|
||||
Pool.start()
|
||||
cron.run(options)
|
||||
try:
|
||||
Pool.start()
|
||||
cron.run(options)
|
||||
except KeyboardInterrupt:
|
||||
pass
|
||||
@@ -32,5 +32,8 @@ from trytond.pool import Pool
|
||||
# Ensure main module can be safely imported by a new interpreter
|
||||
if __name__ == '__main__':
|
||||
with commandline.pidfile(options):
|
||||
Pool.start()
|
||||
worker.work(options)
|
||||
try:
|
||||
Pool.start()
|
||||
worker.work(options)
|
||||
except (KeyboardInterrupt, SystemExit):
|
||||
pass
|
||||
Reference in new issue
Block a user