diff --git a/my/coding/github.py b/my/coding/github.py index cd9a2ed..d609c9e 100644 --- a/my/coding/github.py +++ b/my/coding/github.py @@ -211,8 +211,17 @@ def iter_gdpr_events() -> Iterator[Res[Event]]: yield e -def iter_backup_events(): - model = get_model() +# TODO FIXME shit, cachew would need to support exceptions?? +# TODO ugh. union types are sort of inevitable.. + +# TODO cachew: perhaps warn when function got no params? might end up as TODO +# TODO instead of hash, use 'deps'?? makes it a bit less misleading.. + +# TODO make cahcew optional, warn if it's not available +# TODO dependencies should involve our package and source packages somehow? that's very hard in general of course +from cachew import cachew +@cachew(paths.github.cache_dir, hashf=lambda model: model.sources) +def iter_backup_events(model=get_model()) -> Iterator[Event]: for d in model.events(): yield _parse_event(d)