Skip to content

Commit

Permalink
Cache lib url check
Browse files Browse the repository at this point in the history
  • Loading branch information
jannschu committed Jul 25, 2021
1 parent b3d84d1 commit 0ac95dd
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions mermaid2/plugin.py
Expand Up @@ -74,13 +74,14 @@ def mermaid_lib(self) -> str:
"""
Provides the actual mermaid library used
"""
mermaid_version = self.config['version']
lib = self.extra_mermaid_lib or MERMAID_LIB % mermaid_version
if not url_exists(lib):
raise FileNotFoundError("Cannot find Mermaid library: %s" %
lib)
return lib

if not hasattr(self, '_mermaid_lib'):
mermaid_version = self.config['version']
lib = self.extra_mermaid_lib or MERMAID_LIB % mermaid_version
if not url_exists(lib):
raise FileNotFoundError("Cannot find Mermaid library: %s" %
lib)
self._mermaid_lib = lib
return self._mermaid_lib

@property
def activate_custom_loader(self) -> bool:
Expand Down

0 comments on commit 0ac95dd

Please sign in to comment.