diff --git a/src/modules/platform-api/platform-api.controller.ts b/src/modules/platform-api/platform-api.controller.ts index 0d7fc71..7c1c025 100644 --- a/src/modules/platform-api/platform-api.controller.ts +++ b/src/modules/platform-api/platform-api.controller.ts @@ -845,28 +845,11 @@ export class PlatformApiController { const normalizedPipelineId = this.normalizePipelineId(pipelineId); const normalizedRunId = this.normalizePipelineId(runId); - const result = await this.platformApiService.proxy( + return this.platformApiService.proxy( 'POST', `/pipeline/${normalizedPipelineId}/pipeline_run/${normalizedRunId}/cancel`, user, ); - - // Update Elasticsearch to reflect the canceled run status - try { - await this.elasticsearchService.updateLastRunStatus( - user.customer_name, - pipelineId, - 'CANCELED', - ); - } catch (esError) { - this.logger.warn('Failed to update Elasticsearch after pipeline run cancel', { - pipelineId, - runId, - error: esError.message, - }); - } - - return result; } // ==================== JOBS - COLUMN EDITING ROUTES ==================== diff --git a/src/services/elasticsearch/elasticsearch.service.ts b/src/services/elasticsearch/elasticsearch.service.ts index 7945acf..ab2791a 100644 --- a/src/services/elasticsearch/elasticsearch.service.ts +++ b/src/services/elasticsearch/elasticsearch.service.ts @@ -50,8 +50,6 @@ interface PipelineDocument { type: string; in_use: number; keywords: MultiLangArray; - // Pipeline run tracking - last_run_status?: string; } @Injectable() @@ -360,44 +358,6 @@ export class ElasticsearchService { } } - async updateLastRunStatus( - customerName: string, - pipelineId: string, - lastRunStatus: string, - ): Promise { - const index = this.getIndex(customerName); - const now = new Date().toISOString(); - - this.logger.info('Elasticsearch: Updating last run status', { - index, - pipelineId, - lastRunStatus, - }); - - try { - const response = await this.client.post( - `/${index}/_update/${pipelineId}`, - { - doc: { - last_run_status: lastRunStatus, - updated_at: now, - }, - }, - { params: { refresh: 'wait_for' } }, - ); - - this.logger.info('Elasticsearch: Last run status updated', { - pipelineId, - result: response.data.result, - }); - - return response.data; - } catch (error) { - this.handleError('updateLastRunStatus', error, { pipelineId, index }); - throw error; - } - } - private getDataAssetIndex(customerName: string): string { return `${customerName}_data_assets_catalog`; }