Cache things to speed up the program

This commit is contained in:
2023-01-20 07:48:27 +01:00
parent 9b15b0e399
commit 519066649d
3 changed files with 9 additions and 0 deletions

View File

@ -1,4 +1,5 @@
import os
from functools import lru_cache
from loguru import logger
from platformdirs import user_data_dir
@ -38,6 +39,7 @@ def get_webhook_for_entry(custom_reader: Reader, entry: Entry) -> str:
return webhook_url
@lru_cache()
def get_db_location(custom_location: str = "") -> str:
"""Where we store the database file.
@ -55,6 +57,7 @@ def get_db_location(custom_location: str = "") -> str:
return db_loc
@lru_cache()
def get_reader(custom_location: str = "") -> Reader:
"""Get the reader.