You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From that point, all the usages of the default cache would use the namespace and ttl set, unless passed explicitly in decorators and calls:
@cached(alias='default')asyncdefsomething_cached(self):
# This would cache with the default parameters defined in the configreturnawaitdo_stuff()
@cached(alias='default', namespace='another_namespace', ttl=3600)asyncdefsomething_else_cached(self):
# This would cache with the parameters defined in the decorator instead of the configreturnawaitdo_stuff()
# Same for thesecaches.get('default').get('foo', default=False, namespace='bar_namespace')
caches.get('default').set('foo', True, namespace='bar_namespace', ttl=86400)
The text was updated successfully, but these errors were encountered:
On one hand is the part of specifying all the parameters through config. This is already possible except for TTL but because there is no instance attribute for attribute, its just per function. If you want this, we could add ttl in the class constructor too.
When setting the cache config, I'd like to set there default values (for TTL and namespace for example):
From that point, all the usages of the
default
cache would use the namespace and ttl set, unless passed explicitly in decorators and calls:The text was updated successfully, but these errors were encountered: