refactoring process management: no more orphan processes and quicker chrome startup

This commit is contained in:
Julien Neuhart
2019-10-02 10:38:47 +02:00
parent c47dc5ecdb
commit 7ac104c3c6
8 changed files with 187 additions and 137 deletions

View File

@@ -1,7 +1,6 @@
package main
import (
"context"
"fmt"
"net/http"
"os"
@@ -28,9 +27,8 @@ func main() {
systemLogger.InfofOp(op, "Gotenberg %s", version)
systemLogger.DebugfOp(op, "configuration: %+v", config)
if !config.DisableGoogleChrome() {
// start Google Chrome.
_, err = chrome.Start(context.Background(), systemLogger)
if err != nil {
// start Google Chrome headless.
if err := chrome.Start(systemLogger); err != nil {
systemLogger.FatalOp(op, err)
}
}