feat: not uygulaması ve altyapısını ekle
- iOS Memos benzeri PWA ön yüz eklendi (React, Tailwind) - Express tabanlı arka uç, AnythingLLM API entegrasyonu ve senkronizasyon kuyruğu oluşturuldu - Docker, TypeScript ve proje konfigürasyonları tanımlandı
This commit is contained in:
27
backend/src/queue/cleanup.worker.ts
Normal file
27
backend/src/queue/cleanup.worker.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import { removeDocuments } from "../anythingllm/anythingllm.client.js";
|
||||
import type { CleanupJob } from "./queue.js";
|
||||
import { logError } from "../utils/logger.js";
|
||||
import { readIndex, writeIndex } from "../notes/notes.storage.js";
|
||||
|
||||
export async function handleCleanupJob(job: CleanupJob): Promise<void> {
|
||||
try {
|
||||
await removeDocuments([job.oldLocation]);
|
||||
const index = await readIndex();
|
||||
const updated = index.map((item) => {
|
||||
if (item.id === job.id) {
|
||||
return {
|
||||
...item,
|
||||
sync: {
|
||||
...item.sync,
|
||||
cleanupPending: false
|
||||
}
|
||||
};
|
||||
}
|
||||
return item;
|
||||
});
|
||||
await writeIndex(updated);
|
||||
} catch (error) {
|
||||
logError("Temizlik kuyrugu hatasi", { error: (error as Error).message });
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user