@@ -13,10 +13,10 @@ import type {
1313 TaskManagerStartContract ,
1414} from '@kbn/task-manager-plugin/server' ;
1515import type { CoreSetup , ElasticsearchClient } from '@kbn/core/server' ;
16+ import { ANALYTICS_SYNCHRONIZATION_TASK_TYPE } from '../../../../common/constants' ;
1617import type { CasesServerStartDependencies } from '../../../types' ;
1718import { AnalyticsIndexSynchronizationTaskFactory } from './synchronization_task_factory' ;
1819
19- const TASK_TYPE = 'cai:cases_analytics_index_synchronization' ;
2020const SCHEDULE : IntervalSchedule = { interval : '5m' } ;
2121
2222export function registerCAISynchronizationTask ( {
@@ -34,7 +34,7 @@ export function registerCAISynchronizationTask({
3434 } ;
3535
3636 taskManager . registerTaskDefinitions ( {
37- [ TASK_TYPE ] : {
37+ [ ANALYTICS_SYNCHRONIZATION_TASK_TYPE ] : {
3838 title : 'Synchronization for the cases analytics index' ,
3939 createTaskRunner : ( context : RunContext ) => {
4040 return new AnalyticsIndexSynchronizationTaskFactory ( { getESClient, logger } ) . create (
@@ -64,7 +64,7 @@ export async function scheduleCAISynchronizationTask({
6464 try {
6565 await taskManager . ensureScheduled ( {
6666 id : taskId ,
67- taskType : TASK_TYPE ,
67+ taskType : ANALYTICS_SYNCHRONIZATION_TASK_TYPE ,
6868 params : { sourceIndex, destIndex } ,
6969 schedule : SCHEDULE , // every 5 minutes
7070 state : { } ,
0 commit comments