diff options
Diffstat (limited to 'components/pm-subscription-handler/pmsh_service/mod/network_function.py')
-rwxr-xr-x | components/pm-subscription-handler/pmsh_service/mod/network_function.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/components/pm-subscription-handler/pmsh_service/mod/network_function.py b/components/pm-subscription-handler/pmsh_service/mod/network_function.py index a6d2164f..02656356 100755 --- a/components/pm-subscription-handler/pmsh_service/mod/network_function.py +++ b/components/pm-subscription-handler/pmsh_service/mod/network_function.py @@ -105,6 +105,19 @@ class NetworkFunction: exc_info=True) return not params_set + def increment_retry_count(self): + try: + NetworkFunctionModel.query.filter( + NetworkFunctionModel.nf_name == self.nf_name)\ + .update({'retry_count': NetworkFunctionModel.retry_count + 1}, + synchronize_session='evaluate') + db.session.commit() + except Exception as e: + logger.error(f'Failed to update retry_count of NetworkFunction: {self.nf_name}: {e}', + exc_info=True) + finally: + db.session.remove() + @staticmethod def get(nf_name): """ Retrieves a network function |