import { Logger } from 'src/core/server' ; import { TaskInstance , TaskInstanceWithDeprecatedFields } from '../task' ; export function ensureDeprecatedFieldsAreCorrected ( { id , taskType , interval , schedule , ... taskInstance } , logger ) { if ( interval ) { logger . warn ( `Task${ id ? ` "${ id }"` : '' } of type "${ taskType }" has been scheduled with the deprecated 'interval' field which is due to be removed in a future release` ) ; } return { id , taskType , ... taskInstance , schedule : schedule || ( interval ? { interval } : undefined ) , } ; }