taks use end task util

This commit is contained in:
Robin Olsen
2026-02-23 12:28:10 +01:00
parent a3a9b8293c
commit 2c2fbac3a3
2 changed files with 31 additions and 11 deletions

View File

@@ -24,11 +24,12 @@ Please write your code below this line!
`
type CodingTask struct {
app *service.App
done bool
app *service.App
}
func NewCodingTask(app *service.App) *CodingTask {
return &CodingTask{app: app}
return &CodingTask{app: app, done: false}
}
func (t *CodingTask) Config() task.Config {
@@ -100,5 +101,5 @@ func (t *CodingTask) Validate(ctx context.Context) (bool, error) {
return false, fmt.Errorf("the function does not contain a return statement")
}
return EndTaskWithTimeout(nil, "Task completed!", 5*time.Second)
return EndTaskWithTimeout(&t.done, "Task completed!", 5*time.Second)
}