Skip to content

Commit

Permalink
Cache underlying can_install version checks
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco committed Nov 3, 2020
1 parent 09e4017 commit dcb6887
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions custom_components/hacs/helpers/functions/misc.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Helper functions: misc"""
import re
import semantic_version
from functools import lru_cache

RE_REPOSITORY = re.compile(
r"(?:(?:.*github.com.)|^)([A-Za-z0-9-]+\/[\w.-]+?)(?:(?:\.git)?|(?:[^\w.-].*)?)$"
Expand All @@ -26,6 +27,7 @@ def get_repository_name(repository) -> str:
)


@lru_cache
def version_left_higher_then_right(new: str, old: str) -> bool:
"""Return a bool if source is newer than target, will also be true if identical."""
if not isinstance(new, str) or not isinstance(old, str):
Expand Down

0 comments on commit dcb6887

Please sign in to comment.