Skip to content

Commit 1153828

Browse files
authored
chore: fix stack trace (#5312)
1 parent f74fea3 commit 1153828

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

pkg/tasks/tasks.go

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,16 @@ func StartTaskMonitor(taskID string, finishedChan <-chan error) {
5151
}
5252

5353
func StartTicker(taskID string, finishedChan <-chan struct{}) {
54-
go func() {
55-
for {
56-
select {
57-
case <-time.After(time.Second * 2):
58-
if err := UpdateTaskStatusTimestamp(taskID); err != nil {
59-
logger.Error(err)
60-
}
61-
case <-finishedChan:
62-
return
54+
for {
55+
select {
56+
case <-time.After(time.Second * 2):
57+
if err := UpdateTaskStatusTimestamp(taskID); err != nil {
58+
logger.Error(err)
6359
}
60+
case <-finishedChan:
61+
return
6462
}
65-
}()
63+
}
6664
}
6765

6866
func SetTaskStatus(id string, message string, status string) error {

pkg/upgradeservice/deploy/deploy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ func Deploy(opts DeployOptions) error {
129129

130130
finishedCh := make(chan struct{})
131131
defer close(finishedCh)
132-
tasks.StartTicker(task.GetID(opts.Params.AppSlug), finishedCh)
132+
go tasks.StartTicker(task.GetID(opts.Params.AppSlug), finishedCh)
133133

134134
if err := embeddedcluster.StartClusterUpgrade(context.Background(), opts.KotsKinds, opts.RegistrySettings); err != nil {
135135
return errors.Wrap(err, "failed to start cluster upgrade")

0 commit comments

Comments
 (0)