3c72e9878d
Will be used to cache blobs, thus removing the need to hit the database in most blob requests
8 lines
309 B
Python
8 lines
309 B
Python
from collections import namedtuple
|
|
|
|
class CacheKey(namedtuple('CacheKey', ['key', 'expiration'])):
|
|
""" Defines a key into the data model cache. """
|
|
pass
|
|
|
|
def for_repository_blob(namespace_name, repo_name, digest):
|
|
return CacheKey('repository_blob:%s:%s:%s' % (namespace_name, repo_name, digest), '60s')
|