Changeset View
Changeset View
Standalone View
Standalone View
python_modules/dagster/dagster/cli/workspace/workspace.py
Show First 20 Lines • Show All 233 Lines • ▼ Show 20 Lines | def reload_repository_location(self, location_name): | ||||
# Can be called from a background thread | # Can be called from a background thread | ||||
with self._lock: | with self._lock: | ||||
# Relying on GC to clean up the old location once nothing else | # Relying on GC to clean up the old location once nothing else | ||||
# is referencing it | # is referencing it | ||||
self._location_entry_dict[location_name] = self._load_location( | self._location_entry_dict[location_name] = self._load_location( | ||||
self._location_entry_dict[location_name].origin | self._location_entry_dict[location_name].origin | ||||
) | ) | ||||
def shutdown_repository_location(self, location_name): | |||||
with self._lock: | |||||
self._location_entry_dict[location_name].origin.shutdown_server() | |||||
def reload_workspace(self): | def reload_workspace(self): | ||||
# Can be called from a background thread | # Can be called from a background thread | ||||
with self._lock: | with self._lock: | ||||
self._cleanup_locations() | self._cleanup_locations() | ||||
self._load_workspace() | self._load_workspace() | ||||
def _cleanup_locations(self): | def _cleanup_locations(self): | ||||
assert self._lock.locked() | assert self._lock.locked() | ||||
Show All 39 Lines |