diff --git a/Dockerfile b/Dockerfile index be6efd89..2c6e98b6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.14 as builder +FROM golang:1.16 as builder WORKDIR /app diff --git a/VERSION b/VERSION index a2cec7af..7919852f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.0.8 +4.0.9 diff --git a/mailroom.go b/mailroom.go index f0e76e3b..deaae483 100644 --- a/mailroom.go +++ b/mailroom.go @@ -106,7 +106,8 @@ func (mr *Mailroom) Start() error { mr.DB = db mr.DB.SetMaxIdleConns(8) mr.DB.SetMaxOpenConns(mr.Config.DBPoolSize) - mr.DB.SetConnMaxLifetime(time.Minute * 30) + mr.DB.SetConnMaxIdleTime(time.Minute * 10) + mr.DB.SetConnMaxLifetime(time.Minute * 60) // try connecting ctx, cancel := context.WithTimeout(context.Background(), time.Second) diff --git a/models/channel_connection.go b/models/channel_connection.go index 35f59181..18a58fe2 100644 --- a/models/channel_connection.go +++ b/models/channel_connection.go @@ -355,7 +355,7 @@ func (c *ChannelConnection) MarkErrored(ctx context.Context, db Queryer, now tim c.c.Status = ConnectionStatusErrored c.c.EndedOn = &now - if c.c.RetryCount < ConnectionMaxRetries { + if c.c.RetryCount < ConnectionMaxRetries && (wait > time.Minute) { c.c.RetryCount++ next := now.Add(wait) c.c.NextAttempt = &next