You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using RedisExpireStorage you get the exception: `redis.exceptions.DataError: Invalid input of type: 'function'. Convert to a bytes, string, int or float first.
#12
Open
sluce23andme opened this issue
Aug 16, 2022
· 0 comments
Basically huey.storage.RedisExpireStorage uses a lambda to define self.result_key instead of being a simple string:
classRedisExpireStorage(RedisStorage):
# Redis storage subclass that adds expiration to task result values. Since# the Redis server handles deleting our results after the expiration time,# this storage layer will not delete the results when they are read.def__init__(self, name='huey', expire_time=86400, *args, **kwargs):
super(RedisExpireStorage, self).__init__(name, *args, **kwargs)
self._expire_time=expire_timeself.result_prefix=rp=b'huey.r.%s.'%self.name.encode('utf8')
encode=lambdas: sifisinstance(s, bytes) elses.encode('utf8')
self.result_key=lambdak: rp+encode(k)
I have not looked into this any deeper at this point and have switched to PriorityRedisStorage for now.
The text was updated successfully, but these errors were encountered:
Basically
huey.storage.RedisExpireStorage
uses a lambda to defineself.result_key
instead of being a simple string:I have not looked into this any deeper at this point and have switched to PriorityRedisStorage for now.
The text was updated successfully, but these errors were encountered: