Skip to content

Commit

Permalink
chore: improve automaxprocs logs
Browse files Browse the repository at this point in the history
  • Loading branch information
dunglas committed Dec 14, 2023
1 parent e3e2ab3 commit efa8b24
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions caddy/frankenphp/main.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Copied from https://github.com/caddyserver/xcaddy/blob/b7fd102f41e12be4735dc77b0391823989812ce8/environment.go#L251
package main

import (
"github.com/caddyserver/caddy/v2"
caddycmd "github.com/caddyserver/caddy/v2/cmd"
"go.uber.org/automaxprocs/maxprocs"
"go.uber.org/zap"

// plug in Caddy modules here.
_ "github.com/caddyserver/caddy/v2/modules/standard"
Expand All @@ -13,11 +13,12 @@ import (
_ "github.com/dunglas/vulcain/caddy"
)

func init() {
//nolint:errcheck
maxprocs.Set(maxprocs.Logger(caddy.Log().Sugar().Debugf))
}

func main() {
undo, err := maxprocs.Set()
defer undo()
if err != nil {
caddy.Log().Warn("failed to set GOMAXPROCS", zap.Error(err))
}

caddycmd.Main()
}

0 comments on commit efa8b24

Please sign in to comment.