Skip to content

Commit

Permalink
Some apps may require valid stdin, e.g. vite dev.
Browse files Browse the repository at this point in the history
  • Loading branch information
can1357 committed Mar 12, 2024
1 parent 7dbc078 commit a28f60f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions service/svc_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ type AppService struct {
AutoScaleDefer util.Duration `yaml:"auto_scale_defer,omitempty"` // The time to wait until considering a process in auto-scaling.
UpscalePercent float64 `yaml:"upscale_percent,omitempty"` // The percentage of CPU usage to trigger upscale.
DownscalePercent float64 `yaml:"downscale_percent,omitempty"` // The percentage of CPU usage to trigger downscale.
Stdin bool `yaml:"stdin,omitempty"` // If true, the app will read from stdin.
cluterN int
clusterMin int
}
Expand Down Expand Up @@ -195,6 +196,11 @@ func (app *AppService) createCmd(c context.Context, cmd *Command, build bool, ch
g.Stdout = nil
g.Stderr = nil
}
if app.Stdin && !build {
g.Stdin = os.Stdin
} else {
g.Stdin = nil
}
return
}
func (app *AppService) execCmd(c context.Context, cmd *Command, build bool, chk glob.Checksum) (GluedCommand, error) {
Expand Down

0 comments on commit a28f60f

Please sign in to comment.