|
|
|
@ -480,8 +480,10 @@ def get_wx_ticket_login_info_cache(ticket): |
|
|
|
|
cache.delete(wx_t_key) |
|
|
|
|
return wx_ticket_info |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class CacheBaseState(object): |
|
|
|
|
prefix='' |
|
|
|
|
prefix = '' |
|
|
|
|
|
|
|
|
|
def __init__(self, prefix): |
|
|
|
|
CacheBaseState.prefix = prefix |
|
|
|
|
|
|
|
|
@ -490,14 +492,15 @@ class CacheBaseState(object): |
|
|
|
|
return cache.get(f"{cls.prefix}_{key}") |
|
|
|
|
|
|
|
|
|
@classmethod |
|
|
|
|
def set_state(cls, key,value= time.time(),timeout=3600*24): |
|
|
|
|
def set_state(cls, key, value=time.time(), timeout=3600 * 24): |
|
|
|
|
cls.del_state(f"{cls.prefix}_{key}") |
|
|
|
|
cache.set(f"{cls.prefix}_{key}",value,timeout) |
|
|
|
|
cache.set(f"{cls.prefix}_{key}", value, timeout) |
|
|
|
|
|
|
|
|
|
@classmethod |
|
|
|
|
def del_state(cls,key): |
|
|
|
|
def del_state(cls, key): |
|
|
|
|
cache.delete(f"{cls.prefix}_{key}") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class MigrateStorageState(CacheBaseState): |
|
|
|
|
def __init__(self): |
|
|
|
|
super().__init__('migrate_storage') |
|
|
|
|