Skip to content

Commit 8958c77

Browse files
authored
Fix recursive error from editor using datapusher (#486)
1 parent 4f51e8d commit 8958c77

File tree

3 files changed

+21
-18
lines changed

3 files changed

+21
-18
lines changed

ckanext/querytool/actions.py

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,29 @@
66
log = logging.getLogger(__name__)
77

88

9+
# Test disabling lru_cache
10+
911
# Module API
1012

11-
def resource_delete(context, data_dict):
12-
_clear_get_resource_data_cache()
13-
return delete_core.resource_delete(context, data_dict)
13+
# def resource_delete(context, data_dict):
14+
# _clear_get_resource_data_cache()
15+
# return delete_core.resource_delete(context, data_dict)
1416

1517

16-
def resource_patch(context, data_dict):
17-
_clear_get_resource_data_cache()
18-
return patch_core.resource_patch(context, data_dict)
18+
# def resource_patch(context, data_dict):
19+
# _clear_get_resource_data_cache()
20+
# return patch_core.resource_patch(context, data_dict)
1921

2022

21-
def resource_update(context, data_dict):
22-
_clear_get_resource_data_cache()
23-
return update_core.resource_update(context, data_dict)
23+
# def resource_update(context, data_dict):
24+
# _clear_get_resource_data_cache()
25+
# return update_core.resource_update(context, data_dict)
2426

2527

2628
# Internal
2729

28-
def _clear_get_resource_data_cache():
29-
log.debug('Cache statistics for `helpers.get_resource_data`:')
30-
log.debug(helpers.get_resource_data.cache_info())
31-
helpers.get_resource_data.cache_clear()
32-
log.debug('Cache for `helpers.get_resource_data` has been reset')
30+
# def _clear_get_resource_data_cache():
31+
# log.debug('Cache statistics for `helpers.get_resource_data`:')
32+
# log.debug(helpers.get_resource_data.cache_info())
33+
# helpers.get_resource_data.cache_clear()
34+
# log.debug('Cache for `helpers.get_resource_data` has been reset')

ckanext/querytool/helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ def get_map_data(geojson_url, map_key_field, data_key_field,
501501
return map_data
502502

503503

504-
@functools32.lru_cache(maxsize=128)
504+
# @functools32.lru_cache(maxsize=128)
505505
def get_resource_data(sql_string):
506506
context = {}
507507

ckanext/querytool/plugin.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,11 +236,12 @@ def after_map(self, map):
236236
# IActions
237237

238238
def get_actions(self):
239+
# Disable lru_cache
239240
module_root = 'ckanext.querytool.logic.action'
240241
action_functions = h._get_functions(module_root)
241-
action_functions['resource_delete'] = actions.resource_delete
242-
action_functions['resource_patch'] = actions.resource_patch
243-
action_functions['resource_update'] = actions.resource_update
242+
# action_functions['resource_delete'] = actions.resource_delete
243+
# action_functions['resource_patch'] = actions.resource_patch
244+
# action_functions['resource_update'] = actions.resource_update
244245
return action_functions
245246

246247
# IConfigurable

0 commit comments

Comments
 (0)