Skip to content

Commit

Permalink
add clear_cache runtime method
Browse files Browse the repository at this point in the history
  • Loading branch information
jonmmease committed Nov 15, 2024
1 parent ec399dc commit 7f2f979
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions vegafusion-python/vegafusion/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -786,10 +786,20 @@ def cache_capacity(self, value: int) -> None:
self.reset()

def reset(self) -> None:
"""
Restart the runtime
"""
if self._runtime is not None:
self._runtime.clear_cache()
self._runtime = None

def clear_cache(self) -> None:
"""
Clear the VegaFusion runtime cache
"""
if self._runtime is not None:
self._runtime.clear_cache()

def __repr__(self) -> str:
if self.using_grpc:
return f"VegaFusionRuntime(url={self._grpc_url})"
Expand Down

0 comments on commit 7f2f979

Please sign in to comment.