mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-31 03:41:51 +00:00
refactor(plugins): make runtime registry lazy
This commit is contained in:
@@ -17,7 +17,7 @@ const state: RegistryState = (() => {
|
||||
};
|
||||
if (!globalState[REGISTRY_STATE]) {
|
||||
globalState[REGISTRY_STATE] = {
|
||||
registry: createEmptyPluginRegistry(),
|
||||
registry: null,
|
||||
httpRouteRegistry: null,
|
||||
httpRouteRegistryPinned: false,
|
||||
key: null,
|
||||
@@ -100,9 +100,8 @@ export function getActivePluginRegistryVersion(): number {
|
||||
}
|
||||
|
||||
export function resetPluginRuntimeStateForTest(): void {
|
||||
const emptyRegistry = createEmptyPluginRegistry();
|
||||
state.registry = emptyRegistry;
|
||||
state.httpRouteRegistry = emptyRegistry;
|
||||
state.registry = null;
|
||||
state.httpRouteRegistry = null;
|
||||
state.httpRouteRegistryPinned = false;
|
||||
state.key = null;
|
||||
state.version += 1;
|
||||
|
||||
Reference in New Issue
Block a user