Skip to content

Commit 4ab267a

Browse files
committed
fix: move _initialized flag to end of register(); use embedPassage in import-markdown
1 parent 6b7543e commit 4ab267a

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

cli.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1137,7 +1137,7 @@ export function registerMemoryCLI(program: Command, context: CLIContext): void {
11371137
}
11381138

11391139
try {
1140-
const vector = await context.embedder!.embedQuery(text);
1140+
const vector = await context.embedder!.embedPassage(text);
11411141
await context.store.store({
11421142
text,
11431143
vector,

index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1629,8 +1629,6 @@ const memoryLanceDBProPlugin = {
16291629
api.logger.debug("memory-lancedb-pro: register() called again — skipping re-init (idempotent)");
16301630
return;
16311631
}
1632-
_initialized = true;
1633-
16341632
// Parse and validate configuration
16351633
const config = parsePluginConfig(api.pluginConfig);
16361634

@@ -3730,6 +3728,7 @@ const memoryLanceDBProPlugin = {
37303728
// Run initial backup after a short delay, then schedule daily
37313729
setTimeout(() => void runBackup(), 60_000); // 1 min after start
37323730
backupTimer = setInterval(() => void runBackup(), BACKUP_INTERVAL_MS);
3731+
_initialized = true;
37333732
},
37343733
stop: async () => {
37353734
if (backupTimer) {

0 commit comments

Comments
 (0)