Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def storage_disk(request):
client = diskcache.Cache('/tmp/ring-test/diskcache')
return client, ring.disk
def disk_cache(request):
client = request.param
client.ring = ring.disk
client.is_binary = False
client.has_touch = False
return client
@ring.disk(storage_diskcache, 'ring-test')
def f(a, b):
r = base[0] + a * 100 + b
sr = str(r)
if storage_diskcache.is_binary:
sr = sr.encode('utf-8')
return sr
@ring.disk(disk_cache, 'ring-test')
def f(a, b):
r = base[0] + a * 100 + b
sr = str(r)
if disk_cache.is_binary:
sr = sr.encode('utf-8')
return sr
def storage_diskcache(request):
client = request.param
client.ring = ring.disk
client.is_binary = False
client.has_has = False
client.has_touch = False
client.has_expire = True
return client