Skip to content

Commit

Permalink
fix: get_mfes cache clearing
Browse files Browse the repository at this point in the history
ALWAYS CLEAR CACHE ON PLUGIN LOAD!!!
  • Loading branch information
regisb committed Dec 9, 2023
1 parent 2e4c3f7 commit d38c731
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tutormfe/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,14 @@ def get_mfes() -> dict[str, MFE_ATTRS_TYPE]:
return MFE_APPS.apply({})


@tutor_hooks.Actions.PLUGIN_LOADED.add()
def _clear_get_mfes_cache(_name: str):
"""
Don't forget to clear cache, or we'll have some strange surprises...
"""
get_mfes.cache_clear()


def iter_mfes() -> t.Iterable[tuple[str, MFE_ATTRS_TYPE]]:
"""
Yield:
Expand Down

0 comments on commit d38c731

Please sign in to comment.