Silent exit of cron and worker with keyboard
This commit is contained in:
@@ -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