mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 11:36:07 -04:00
Add a cache for get_event
This commit is contained in:
parent
d8324d5a2b
commit
f5a70e0d2e
6 changed files with 43 additions and 5 deletions
|
@ -27,6 +27,16 @@ class Config(object):
|
|||
def __init__(self, args):
|
||||
pass
|
||||
|
||||
@staticmethod
|
||||
def parse_size(string):
|
||||
sizes = {"K": 1024, "M": 1024 * 1024}
|
||||
size = 1
|
||||
suffix = string[-1]
|
||||
if suffix in sizes:
|
||||
string = string[:-1]
|
||||
size = sizes[suffix]
|
||||
return int(string) * size
|
||||
|
||||
@staticmethod
|
||||
def abspath(file_path):
|
||||
return os.path.abspath(file_path) if file_path else file_path
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue