mirror of
https://git.pleroma.social/pleroma/relay.git
synced 2024-11-24 23:41:09 +00:00
add ability to change cache size
This commit is contained in:
parent
f397e10b04
commit
c1c4b24b0a
|
@ -28,7 +28,7 @@ class Application(web.Application):
|
|||
self['database'] = RelayDatabase(self['config'])
|
||||
self['database'].load()
|
||||
|
||||
self['cache'] = DotDict({key: LRUCache(maxsize=self['config'][key]) for key in self['config'].cachekeys})
|
||||
self['cache'] = DotDict({key: Cache(maxsize=self['config'][key]) for key in self['config'].cachekeys})
|
||||
self['semaphore'] = asyncio.Semaphore(self['config'].push_limit)
|
||||
|
||||
self.set_signal_handler()
|
||||
|
@ -117,3 +117,8 @@ class Application(web.Application):
|
|||
|
||||
self['starttime'] = None
|
||||
self['running'] = False
|
||||
|
||||
|
||||
class Cache(LRUCache):
|
||||
def set_maxsize(self, value):
|
||||
self.__maxsize = int(value)
|
||||
|
|
Loading…
Reference in a new issue