Skip to content

Commit

Permalink
Added check cache key util (apache#4432)
Browse files Browse the repository at this point in the history
* added check cache key util

* change docstring

* add has_access_api decorator
  • Loading branch information
hughhhh authored and mistercrunch committed Feb 15, 2018
1 parent dea75d0 commit acea8f2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions superset/views/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2221,6 +2221,16 @@ def cached_key(self, key):
return resp
return 'nope'

@has_access_api
@expose('/cache_key_exist/<key>/')
@log_this
def cache_key_exist(self, key):
"""Returns if a key from cache exist"""
key_exist = True if cache.get(key) else False
status = 200 if key_exist else 404
return json_success(json.dumps({'key_exist': key_exist}),
status=status)

@has_access_api
@expose('/results/<key>/')
@log_this
Expand Down

0 comments on commit acea8f2

Please sign in to comment.