Skip to content

Commit

Permalink
clean up code
Browse files Browse the repository at this point in the history
  • Loading branch information
maartenbreddels committed Jun 28, 2023
1 parent 9547fdd commit 72e2c8b
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions solara/server/reload.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,10 @@ def get_reload_module_names(self):
if name.startswith("solara.server"):
continue # this will break everything
if name in self.ignore_modules:
continue # nothing we imported from solara itself
if hasattr(mod, "__file__") and mod.__file__:
if not mod.__file__.startswith(str(self.root_path)):
logger.debug("Ignoring module %s", mod)
continue
else:
logger.debug("Ignoring module %s because we do not know the path", mod)
continue
reload.append(name)
continue # nothing we imported from solara itself like starlette etc
# we only reload modules that are in the root path
if getattr(mod, "__file__", "").startswith(str(self.root_path)):
reload.append(name)
return reload

def reload(self):
Expand Down

0 comments on commit 72e2c8b

Please sign in to comment.