mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-06 05:51:15 +08:00
fix(memory): reattach Linux watchers on directory rename
(cherry picked from commit 0db7781514cc84fac4f3a999d24b4b747fc871f9)
This commit is contained in:
@@ -777,7 +777,7 @@ export abstract class MemoryManagerSyncOps {
|
||||
watcher = resolveMemoryNativeWatchFactory()(
|
||||
watchDir,
|
||||
{ recursive: false },
|
||||
(_eventType, filename) => {
|
||||
(eventType, filename) => {
|
||||
if (filename == null) {
|
||||
markDirty();
|
||||
if (!this.attachLinuxMemoryDirectoryTreeSubtree(watchDir, attachDirectory)) {
|
||||
@@ -799,6 +799,9 @@ export abstract class MemoryManagerSyncOps {
|
||||
closeDirectorySubtree(full);
|
||||
}
|
||||
if (stats?.isDirectory()) {
|
||||
if (eventType === "rename") {
|
||||
closeDirectorySubtree(full);
|
||||
}
|
||||
if (!this.attachLinuxMemoryDirectoryTreeSubtree(full, attachDirectory)) {
|
||||
closeAndFallback(
|
||||
`failed to attach Linux memory directory watcher under ${full}; falling back to chokidar`,
|
||||
|
||||
Reference in New Issue
Block a user