mirror of
https://github.com/gotenberg/gotenberg.git
synced 2026-08-16 12:22:17 +01:00
fix(uno): close tcp connexions to the LibreOffice listener, better health check that take the restart into account
This commit is contained in:
@@ -179,10 +179,10 @@ func (mod UNO) Start() error {
|
||||
// StartupMessage returns a custom startup message.
|
||||
func (mod UNO) StartupMessage() string {
|
||||
if mod.libreOfficeRestartThreshold == 0 {
|
||||
return "Long-running LibreOffice listener disabled"
|
||||
return "long-running LibreOffice listener disabled"
|
||||
}
|
||||
|
||||
return "Long-running LibreOffice listener started"
|
||||
return "long-running LibreOffice listener started"
|
||||
}
|
||||
|
||||
// Stop stops the long-running LibreOffice Listener if it exists.
|
||||
@@ -288,10 +288,6 @@ func (mod UNO) Checks() ([]health.CheckerOption, error) {
|
||||
|
||||
return errors.New("long-running LibreOffice listener unhealthy")
|
||||
},
|
||||
// The long-running LibreOffice listener may be restarting, so we
|
||||
// wait a given amount of time until we consider the module
|
||||
// unavailable.
|
||||
MaxTimeInError: mod.libreOfficeStartTimeout,
|
||||
}),
|
||||
}, nil
|
||||
}
|
||||
@@ -339,6 +335,8 @@ func (mod UNO) PDF(ctx context.Context, logger *zap.Logger, inputPath, outputPat
|
||||
err := mod.listener.unlock(logger)
|
||||
if err != nil {
|
||||
mod.logger.Error(fmt.Sprintf("unlock long-running LibreOffice listener: %v", err))
|
||||
|
||||
return
|
||||
}
|
||||
}()
|
||||
}()
|
||||
|
||||
Reference in New Issue
Block a user