diff --git a/cmd/web-api/main.go b/cmd/web-api/main.go index 0e92a7f..649d86c 100644 --- a/cmd/web-api/main.go +++ b/cmd/web-api/main.go @@ -393,6 +393,9 @@ func main() { } defer masterDb.Close() + // Enable AWS to auto pause the DB when no activity. + masterDb.SetConnMaxLifetime(time.Hour) + // ========================================================================= // Notify Email var notifyEmail notify.Email diff --git a/cmd/web-app/main.go b/cmd/web-app/main.go index 0db88db..31674d5 100644 --- a/cmd/web-app/main.go +++ b/cmd/web-app/main.go @@ -396,6 +396,9 @@ func main() { } defer masterDb.Close() + // Enable AWS to auto pause the DB when no activity. + masterDb.SetConnMaxLifetime(time.Hour) + // ========================================================================= // Notify Email var notifyEmail notify.Email