contentdb/app/rediscache.py

14 lines
334 B
Python
Raw Normal View History

2019-11-18 22:42:56 +01:00
from . import r
# This file acts as a facade between the releases code and redis,
# and also means that the releases code avoids knowing about `app`
def make_download_key(ip, package):
2020-12-04 03:23:04 +01:00
return "{}/{}/{}".format(ip, package.author.username, package.name)
2019-11-18 22:42:56 +01:00
def set_key(key, v):
r.set(key, v)
def has_key(key):
return r.exists(key)