Kaynağa Gözat

Refactor bulk and search methods to remove async keyword in ES7, ES8, and ES9 client delegators

Shun Miyazawa 9 ay önce
ebeveyn
işleme
556de509b5

+ 2 - 2
apps/app/src/server/service/search-delegator/elasticsearch-client-delegator/es7-client-delegator.ts

@@ -17,7 +17,7 @@ export class ES7ClientDelegator implements IElasticsearchClientDelegator {
     this.client = new Client({ ...options, ssl: { rejectUnauthorized } });
   }
 
-  async bulk(params: RequestParams.Bulk): Promise<ApiResponse<estypes.BulkResponse>> {
+  bulk(params: RequestParams.Bulk): Promise<ApiResponse<estypes.BulkResponse>> {
     return this.client.bulk(params);
   }
 
@@ -58,7 +58,7 @@ export class ES7ClientDelegator implements IElasticsearchClientDelegator {
     return this.client.reindex({ wait_for_completion: false, body: { source: { index: indexName }, dest: { index: tmpIndexName } } });
   }
 
-  async search(params: RequestParams.Search): Promise<ApiResponse<estypes.SearchResponse>> {
+  search(params: RequestParams.Search): Promise<ApiResponse<estypes.SearchResponse>> {
     return this.client.search(params);
   }
 

+ 2 - 2
apps/app/src/server/service/search-delegator/elasticsearch-client-delegator/es8-client-delegator.ts

@@ -11,7 +11,7 @@ export class ES8ClientDelegator implements IElasticsearchClientDelegator {
     this.client = new Client({ ...options, tls: { rejectUnauthorized } });
   }
 
-  async bulk(params: estypes.BulkRequest): Promise<estypes.BulkResponse> {
+  bulk(params: estypes.BulkRequest): Promise<estypes.BulkResponse> {
     return this.client.bulk(params);
   }
 
@@ -48,7 +48,7 @@ export class ES8ClientDelegator implements IElasticsearchClientDelegator {
     return this.client.reindex({ wait_for_completion: false, source: { index: indexName }, dest: { index: tmpIndexName } });
   }
 
-  async search(params: estypes.SearchRequest): Promise<estypes.SearchResponse> {
+  search(params: estypes.SearchRequest): Promise<estypes.SearchResponse> {
     return this.client.search(params);
   }
 

+ 2 - 2
apps/app/src/server/service/search-delegator/elasticsearch-client-delegator/es9-client-delegator.ts

@@ -10,7 +10,7 @@ export class ES9ClientDelegator implements IElasticsearchClientDelegator {
     this.client = new Client({ ...options, tls: { rejectUnauthorized } });
   }
 
-  async bulk(params: estypes.BulkRequest): Promise<estypes.BulkResponse> {
+  bulk(params: estypes.BulkRequest): Promise<estypes.BulkResponse> {
     return this.client.bulk(params);
   }
 
@@ -47,7 +47,7 @@ export class ES9ClientDelegator implements IElasticsearchClientDelegator {
     return this.client.reindex({ wait_for_completion: false, source: { index: indexName }, dest: { index: tmpIndexName } });
   }
 
-  async search(params: estypes.SearchRequest): Promise<estypes.SearchResponse> {
+  search(params: estypes.SearchRequest): Promise<estypes.SearchResponse> {
     return this.client.search(params);
   }