diff options
author | 2020-06-22 18:51:43 +0100 | |
---|---|---|
committer | 2020-07-06 09:07:37 +0100 | |
commit | 0464347539f931847ab578ff935994aef0102352 (patch) | |
tree | 601971765ec6b363b6755984e437c02bea3c83ec /components/pm-subscription-handler/pmsh_service/mod/exit_handler.py | |
parent | b80449b81a2deb3b6e2510a655de02f9375ef636 (diff) |
[PMSH] Add enable_tls boolean flag to config1.1.0
Signed-off-by: efiacor <fiachra.corcoran@est.tech>
Change-Id: I19f71b690f743980eaa149c9b2c76fecb98a0120
Issue-ID: DCAEGEN2-2146
Diffstat (limited to 'components/pm-subscription-handler/pmsh_service/mod/exit_handler.py')
-rwxr-xr-x | components/pm-subscription-handler/pmsh_service/mod/exit_handler.py | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/components/pm-subscription-handler/pmsh_service/mod/exit_handler.py b/components/pm-subscription-handler/pmsh_service/mod/exit_handler.py index 01cb8dc3..3d02375d 100755 --- a/components/pm-subscription-handler/pmsh_service/mod/exit_handler.py +++ b/components/pm-subscription-handler/pmsh_service/mod/exit_handler.py @@ -39,11 +39,14 @@ class ExitHandler: logger.debug(f'ExitHandler was called with signal number: {sig_num}.') current_sub = self.subscription_handler.current_sub if current_sub and current_sub.administrativeState == AdministrativeState.UNLOCKED.value: - for thread in self.periodic_tasks: - logger.debug(f'Cancelling periodic task with thread name: {thread.name}.') - thread.cancel() - current_sub.administrativeState = AdministrativeState.LOCKED.value - current_sub.process_subscription(current_sub.get_network_functions(), - self.subscription_handler.mr_pub, - self.subscription_handler.app_conf) + try: + for thread in self.periodic_tasks: + logger.debug(f'Cancelling periodic task with thread name: {thread.name}.') + thread.cancel() + current_sub.administrativeState = AdministrativeState.LOCKED.value + current_sub.process_subscription(current_sub.get_network_functions(), + self.subscription_handler.mr_pub, + self.subscription_handler.app_conf) + except Exception as e: + logger.error(f'Failed to shut down PMSH application: {e}', exc_info=True) ExitHandler.shutdown_signal_received = True |