Remove all gaelleries before sync

This commit is contained in:
2023-10-02 15:54:28 +08:00
parent 0b3948ee14
commit d3cf414146
2 changed files with 5 additions and 0 deletions

View File

@@ -128,6 +128,10 @@ export class MeiliSearchServer {
const gmeta = await this.gmeta;
await this.waitTask(gmeta.deleteDocument(gid));
}
async removeAllGallery() {
const gmeta = await this.gmeta;
await this.waitTask(gmeta.deleteAllDocuments());
}
async updateGallery(...gids: number[]) {
const gmeta = await this.gmeta;
const datas = gids.map((gid) => {

View File

@@ -6,6 +6,7 @@ export async function update_meili_search_data(
manager: TaskManager,
) {
if (!manager.meilisearch) throw Error("MeiliServer not found.");
await manager.meilisearch.removeAllGallery();
const progress: TaskUpdateMeiliSearchDataProgress = {
total_gallery: 0,
updated_gallery: 0,