Skip to content

Commit

Permalink
fix: no retry for auto shutdown apps
Browse files Browse the repository at this point in the history
  • Loading branch information
pirosiki197 committed Jan 8, 2025
1 parent 504b2d2 commit 0e69d85
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 0 additions & 1 deletion pkg/infrastructure/backend/dockerimpl/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ type Config struct {
// Middleware section defines middleware settings.
Middleware struct {
// Sablier (https://github.com/acouvreur/sablier) starts user apps on demand and shuts them down after a certain time.
// Apps which enable auto shutdown should be able to handle SIGTERM signal.
Sablier struct {
Enable bool `mapstructure:"enable" yaml:"enable"`
SablierURL string `mapstructure:"url" yaml:"url"`
Expand Down
5 changes: 3 additions & 2 deletions pkg/infrastructure/backend/dockerimpl/synchronize_runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,9 @@ func (b *Backend) syncAppContainer(ctx context.Context, app *domain.RuntimeDesir
hostConfig := &container.HostConfig{
PortBindings: make(map[nat.Port][]nat.PortBinding),
RestartPolicy: container.RestartPolicy{
Name: "on-failure",
MaximumRetryCount: 5,
Name: "on-failure",
// sablier stops the container, so we don't need to restart it
MaximumRetryCount: lo.Ternary(b.useSablierMiddleware(app.App), 0, 5),
},
}
for _, p := range app.App.PortPublications {
Expand Down

0 comments on commit 0e69d85

Please sign in to comment.