Added more explicit logging for method dispatch to run a particular intervention

This commit is contained in:
Victor Ng 2018-08-13 17:00:26 -04:00
Родитель f5203972dc
Коммит 54340eca10
1 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

@ -141,8 +141,11 @@ class RecommendationManager:
# Select recommendation output based on extra_data['branch']
branch_selector = extra_data.get('branch', INTERVENTION_CONTROL)
method_selector = branch_selector.replace('-', '_')
method_name = 'recommend_{}'.format(method_selector)
self.logger.info("Dispatching to method [{}]".format(method_name))
branch_method = getattr(self, 'recommend_%s' % method_selector)
return branch_method(client_info, client_id, limit, extra_data)