From 41e38c3b2084462138d8b80e8bba149c1f67c5be Mon Sep 17 00:00:00 2001 From: mdwitr0 Date: Wed, 3 Apr 2024 22:14:03 +0200 Subject: [PATCH] perf: optimize search sync --- src/search-sync/search-sync.service.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/search-sync/search-sync.service.ts b/src/search-sync/search-sync.service.ts index bc4e6e4..d4be464 100644 --- a/src/search-sync/search-sync.service.ts +++ b/src/search-sync/search-sync.service.ts @@ -24,8 +24,9 @@ export class SearchSyncService { private readonly movieService: MovieService, private readonly personService: PersonService, ) { + this.searchSyncModel.deleteMany({}); this.syncMovies(); - this.syncPersons(); + // this.syncPersons(); } private async syncData(entityType: EntityTypes, items: Entity[], pageIndex: number): Promise { @@ -107,7 +108,7 @@ export class SearchSyncService { async syncMovies() { this.logger.log('Starting sync for movies'); await this.syncEntity(MOVIE_V1_4_INDEX, this.movieService, 10000); - await this.syncEntity(MOVIE_INDEX, this.movieService, 10000); + // await this.syncEntity(MOVIE_INDEX, this.movieService, 10000); this.logger.log('Finished sync for movies'); }