rosenpin / i3-agenda

Show your next google calendar event in polybar, swiftbar, i3-bar, simple-bar, bitbar or any other bar with custom scripts support

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cache is never updated

matclab opened this issue · comments

Looking at the code I see :

def load_cache(cachettl: int) -> Optional[List[Event]]:
    if not os.path.exists(CACHE_PATH):
        return None

    if os.path.getmtime(CACHE_PATH) - time.time() > cachettl * 60:
        return None

But os.path.getmtime(CACHE_PATH) - time.time() is negative and thus the function always return the cache content, whatever the value of cachettl is.