|
# -*- coding: utf-8 -*-
from TimeConvert import TimeConvert as tc
from utils.redis.connect import r
from utils.redis.rkeys import TWJC_FEVER_STAMP_HASH
def set_fever_stamp(macid):
r.hset(TWJC_FEVER_STAMP_HASH, macid, tc.utc_timestamp())
def del_fever_stamp(macid):
return r.hdel(TWJC_FEVER_STAMP_HASH, macid)
def get_fever_stamp(macid):
return r.hgetint(TWJC_FEVER_STAMP_HASH, macid)
def get_fever_delta_stamp(macid):
stamp = get_fever_stamp(macid)
if not stamp:
return 0
return tc.utc_timestamp() - stamp
|