Skip to content

Watch mode not waiting for running task to properly terminate #2419

@struckchure

Description

@struckchure

Description

I tried using taskfile to automatically reload a Go project using echo, and also tried it with NestJS. The reload is being triggered, but I always get an error that translates to "the current port I'm trying to start my app on is being used" (by the previously terminated process), my guess here is taskfile didn't wait for the process to be fully terminated before starting a new one or maybe I'm missing an extra configuration.

Code Sample

// main.go

package internals

import "github.com/labstack/echo/v4"

func main() {
    e := echo.New()
    e.Start(":8000")
}

Version

3

Operating system

MacBook M1 Pro 2020

Experiments Enabled

No response

Example Taskfile

version: 3

tasks:
  dev:
    watch: true
    sources:
      - '**/*.go'
    cmd: go run .

Metadata

Metadata

Assignees

Labels

area: watcherChanges related to the Taskfile watcher.lang: goPull requests that update Go code.state: awaiting responseWaiting for issue author to respond.state: working as intendedThe issue described is working as originally intended.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions