mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2026-04-06 07:47:53 +10:00
avoid auto-starting all supervisord workers on startup
This commit is contained in:
@@ -77,12 +77,16 @@ class BaseHook(BaseModel):
|
||||
"""e.g. builtin_plugins.singlefile.apps.SinglefileConfigSet"""
|
||||
return f'{self.__module__}.{self.__class__.__name__}'
|
||||
|
||||
@property
|
||||
def hook_file(self) -> Path:
|
||||
"""e.g. builtin_plugins.singlefile.apps.SinglefileConfigSet"""
|
||||
return Path(inspect.getfile(self.__class__))
|
||||
|
||||
@property
|
||||
def plugin_module(self) -> str:
|
||||
"""e.g. builtin_plugins.singlefile"""
|
||||
return f"{self.__module__}.{self.__class__.__name__}".split("archivebox.", 1)[-1].rsplit(".apps.", 1)[0]
|
||||
|
||||
@computed_field
|
||||
|
||||
@property
|
||||
def plugin_dir(self) -> Path:
|
||||
return Path(inspect.getfile(self.__class__)).parent.resolve()
|
||||
@@ -97,7 +101,7 @@ class BaseHook(BaseModel):
|
||||
|
||||
# record installed hook in settings.HOOKS
|
||||
settings.HOOKS[self.id] = self
|
||||
|
||||
|
||||
if settings.HOOKS[self.id].is_registered:
|
||||
raise Exception(f"Tried to run {self.hook_module}.register() but its already been called!")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user