// UpdateSubTask update config for a sub task.
UpdateSubTask update config for a sub task.
// UpdateSubTask update config for a sub task .
func (w *SourceWorker) UpdateSubTask(ctx context.Context, cfg *config.SubTaskConfig, needLock bool) error {
	if needLock {
		w.Lock()
		defer w.Unlock()
	}
	if w.closed.Load() {
		return terror.ErrWorkerAlreadyClosed.Generate()
	}
	st := w.subTaskHolder.findSubTask(cfg.Name)
	if st == nil {
		return terror.ErrWorkerSubTaskNotFound.Generate(cfg.Name)
	}
	w.l.Info("update sub task", zap.String("task", cfg.Name))
	return st.Update(ctx, cfg)
}
func ( w * SourceWorker ) UpdateSubTask ( ctx context . Context , cfg * config . SubTaskConfig , needLock bool ) error { if needLock { w . Lock ( ) defer w . Unlock ( ) } if w . closed . Load ( ) { return terror . ErrWorkerAlreadyClosed . Generate ( ) } st := w . subTaskHolder . findSubTask ( cfg . Name ) if st == nil { return terror . ErrWorkerSubTaskNotFound . Generate ( cfg . Name ) } w . l . Info ( " " , zap . String ( " " , cfg . Name ) ) return st . Update ( ctx , cfg ) }
UpdateSubTask update config for a sub task.
UpdateSubTask update config for a sub task .