mirror of
https://github.com/gotenberg/gotenberg.git
synced 2026-08-14 11:22:15 +01:00
fix: LibreOffice newer versions stability (#697)
This commit is contained in:
@@ -5,10 +5,11 @@ import (
|
||||
"regexp"
|
||||
"time"
|
||||
|
||||
"github.com/gotenberg/gotenberg/v7/pkg/gotenberg"
|
||||
"github.com/gotenberg/gotenberg/v7/pkg/modules/api"
|
||||
flag "github.com/spf13/pflag"
|
||||
"go.uber.org/multierr"
|
||||
|
||||
"github.com/gotenberg/gotenberg/v7/pkg/gotenberg"
|
||||
"github.com/gotenberg/gotenberg/v7/pkg/modules/api"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -103,27 +104,9 @@ func (w Webhook) Middlewares() ([]api.Middleware, error) {
|
||||
}, nil
|
||||
}
|
||||
|
||||
// AddGraceDuration increases the grace duration provided by the API for the
|
||||
// garbage collector.
|
||||
func (w Webhook) AddGraceDuration() time.Duration {
|
||||
var duration time.Duration
|
||||
|
||||
if w.disable {
|
||||
return duration
|
||||
}
|
||||
|
||||
for i := 0; i < w.maxRetry; i++ {
|
||||
// Yep... Golang does not allow int * time.Duration.
|
||||
duration += w.retryMaxWait
|
||||
}
|
||||
|
||||
return duration
|
||||
}
|
||||
|
||||
// Interface guards.
|
||||
var (
|
||||
_ gotenberg.Module = (*Webhook)(nil)
|
||||
_ gotenberg.Provisioner = (*Webhook)(nil)
|
||||
_ api.MiddlewareProvider = (*Webhook)(nil)
|
||||
_ api.GarbageCollectorGraceDurationIncrementer = (*Webhook)(nil)
|
||||
_ gotenberg.Module = (*Webhook)(nil)
|
||||
_ gotenberg.Provisioner = (*Webhook)(nil)
|
||||
_ api.MiddlewareProvider = (*Webhook)(nil)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user