Skip to content

Commit

Permalink
use cache for contexts.context(alias) function
Browse files Browse the repository at this point in the history
  • Loading branch information
leo-schick committed May 5, 2022
1 parent 664ce8b commit e8e3c76
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mara_pipelines/contexts/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import functools

from .. import shell


Expand Down Expand Up @@ -46,6 +48,7 @@ def run_shell_command(self, shell_command: str) -> bool:
return shell.run_shell_command(shell_command, bash_command_string=self.bash_command_string)


@functools.lru_cache(maxsize=None)
def context(alias: str) -> ExecutionContext:
"""Returns a execution config by alias"""
from .. import config
Expand Down

0 comments on commit e8e3c76

Please sign in to comment.