烧杯缓存抱怨 TypeError。我在谷歌上搜索过,甚至跟踪了烧杯的问题跟踪器,但找不到任何东西。
我像以下方法一样缓存查询
@staticmethod
def get_queries(query):
@cache.cache(query, type = 'file', expire = 300)
def load(query):
entries = db.get_expensive_query(query)
return entries
return load(query)
但是,当我运行程序时,这就是我收到的;
File "/Users/ivan/project/controller/caching.py", line 15, in get_queries
return load(query)
File "/Library/Python/2.6/site-packages/Beaker-1.5.4-py2.6.egg/beaker/cache.py", line 417, in cached
return cache[0].get_value(cache_key, createfunc=go)
File "/Library/Python/2.6/site-packages/Beaker-1.5.4-py2.6.egg/beaker/cache.py", line 214, in get
return self._get_value(key, **kw).get_value()
File "/Library/Python/2.6/site-packages/Beaker-1.5.4-py2.6.egg/beaker/container.py", line 256, in get_value
if not self._is_expired(stored, expired):
File "/Library/Python/2.6/site-packages/Beaker-1.5.4-py2.6.egg/beaker/container.py", line 245, in _is_expired
time.time() >= expiretime + storedtime
TypeError: cannot concatenate 'str' and 'float' objects
我做错了什么还是这是一个烧杯的错误?