| Total Complexity | 19 |
| Total Lines | 118 |
| Duplicated Lines | 0 % |
| 1 | import eventlet |
||
| 30 | LOG.info('(PID=%s) Actions notifier started.', os.getpid()) |
||
| 31 | actions_notifier = notifier.get_notifier() |
||
| 32 | actions_rescheduler = scheduler.get_rescheduler() |
||
| 33 | try: |
||
| 34 | eventlet.spawn(actions_rescheduler.start) |
||
| 35 | actions_notifier.start(wait=True) |
||
| 36 | except (KeyboardInterrupt, SystemExit): |
||
| 37 | LOG.info('(PID=%s) Actions notifier stopped.', os.getpid()) |
||
| 38 | actions_rescheduler.shutdown() |
||
| 39 | actions_notifier.shutdown() |
||
| 40 | except: |
||
| 41 | return 1 |
||
| 42 | return 0 |
||
| 43 | |||
| 44 | |||
| 45 | def _teardown(): |
||
| 46 | common_teardown() |
||
| 47 | |||
| 48 | |||
| 49 | def main(): |
||
| 50 | try: |
||
| 51 | _setup() |
||
| 52 | return _run_worker() |
||
| 53 | except SystemExit as exit_code: |
||
| 54 | sys.exit(exit_code) |
||
| 55 | except: |
||
| 56 | LOG.exception('(PID=%s) Results tracker quit due to exception.', os.getpid()) |
||
| 57 | return 1 |
||
| 58 | finally: |
||
| 59 | _teardown() |
||
| 60 |