Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
roei3000b committed Mar 4, 2024
1 parent 5ce4059 commit 0639c6e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/dlx/resourcestarter.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ func (r *ResourceStarter) startResource(ctx context.Context, resourceSinkChannel
defer close(resourceReadyChannel)

waitResourceReadinessCtx, cancelFunc := context.WithCancel(ctx)
waitResourceReadinessCtx, cancelFuncTimeout := context.WithTimeout(waitResourceReadinessCtx, 15*time.Minute)

defer cancelFunc()
defer cancelFuncTimeout()

go r.waitResourceReadiness(waitResourceReadinessCtx,
scalertypes.Resource{Name: resourceName,
Expand Down Expand Up @@ -167,7 +170,7 @@ func (r *ResourceStarter) waitResourceReadiness(ctx context.Context,

// callee decided to cancel, the resourceReadyChannel is already closed,
// so we can just return without sending anything
if errors.Is(err, context.Canceled) {
if ctx.Err() != nil {
r.logger.WarnWithCtx(ctx,
"Wait resource readiness canceled",
"resourceName", resource.Name)
Expand Down

0 comments on commit 0639c6e

Please sign in to comment.