# 链接数据库
self.handle = redis.Redis(host=host,
port=port,
db=db,
password=password,
decode_responses=True)

# 设置过期时间500秒, 通过ex参数设置
self.handle.set(key, value, ex=500)

相关文章:

  • 2022-12-23
  • 2022-03-04
  • 2022-12-23
  • 2023-01-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-06-02
  • 2022-02-18
  • 2021-07-24
  • 2022-12-23
相关资源
相似解决方案