From 9e23d0a407e8c844bfe74f6376a8fc7ce6a6667b Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sun, 5 Nov 2017 15:16:54 +0100 Subject: [PATCH] The action should be placed in the body again before retrying --- runbullet/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/runbullet/__init__.py b/runbullet/__init__.py index 1e39834bf..6cf25e7a9 100644 --- a/runbullet/__init__.py +++ b/runbullet/__init__.py @@ -77,7 +77,8 @@ def _exec_func(body, retry=True): return target = body.pop('target') - tokens = body.pop('action').split('.') + action = body.pop('action') + tokens action.split('.') module_name = str.join('.', tokens[:-1]) method_name = tokens[-1:][0] @@ -109,6 +110,9 @@ def _exec_func(body, retry=True): except Exception as e: logging.exception(e) if retry: + # Put the action back where it was before retrying + body['action'] = action + logging.info('Reloading plugin {} and retrying'.format(module_name)) _init_plugin(module_name, reload=True) _exec_func(body, retry=False)