From e3d4e3534740dfc47ced157cf0fdc0ff198695a1 Mon Sep 17 00:00:00 2001 From: Chin-Ya Huang Date: Thu, 22 Feb 2024 15:10:06 +0800 Subject: [PATCH] refactor(recurring-job): remove unused method Signed-off-by: Chin-Ya Huang --- app/recurring_job.go | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/app/recurring_job.go b/app/recurring_job.go index 370997dace..9e513f4ab3 100644 --- a/app/recurring_job.go +++ b/app/recurring_job.go @@ -823,24 +823,6 @@ func (job *Job) GetSettingAsBool(name types.SettingName) (bool, error) { return value, nil } -// waitForVolumeState timeout in second -func (job *Job) waitForVolumeState(state string, timeout int) (*longhornclient.Volume, error) { - volumeAPI := job.api.Volume - volumeName := job.volumeName - - for i := 0; i < timeout; i++ { - volume, err := volumeAPI.ById(volumeName) - if err == nil { - if volume.State == state { - return volume, nil - } - } - time.Sleep(1 * time.Second) - } - - return nil, fmt.Errorf("timeout waiting for volume %v to be in state %v", volumeName, state) -} - // handleAttachmentTicketCreation check and create attachment so that the source volume doesn't get detached during the job. func (job *Job) handleAttachmentTicketCreation(volumeName string) (err error) { defer func() {