all: Use own automaxprocs package that doesn't log (ref #9436) (#9437)

### Purpose

🤫
This commit is contained in:
Jakob Borg 2024-02-27 13:05:19 +01:00 committed by GitHub
parent aa559bf496
commit 07a9fa2dbd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
20 changed files with 37 additions and 22 deletions

View File

@ -33,8 +33,8 @@ import (
"text/template" "text/template"
"time" "time"
_ "github.com/syncthing/syncthing/lib/automaxprocs"
buildpkg "github.com/syncthing/syncthing/lib/build" buildpkg "github.com/syncthing/syncthing/lib/build"
_ "go.uber.org/automaxprocs"
) )
var ( var (

View File

@ -15,8 +15,8 @@ import (
"os" "os"
"path/filepath" "path/filepath"
_ "github.com/syncthing/syncthing/lib/automaxprocs"
"github.com/syncthing/syncthing/lib/sha256" "github.com/syncthing/syncthing/lib/sha256"
_ "go.uber.org/automaxprocs"
) )
func main() { func main() {

View File

@ -25,9 +25,9 @@ import (
"github.com/alecthomas/kong" "github.com/alecthomas/kong"
raven "github.com/getsentry/raven-go" raven "github.com/getsentry/raven-go"
"github.com/prometheus/client_golang/prometheus/promhttp" "github.com/prometheus/client_golang/prometheus/promhttp"
_ "github.com/syncthing/syncthing/lib/automaxprocs"
"github.com/syncthing/syncthing/lib/sha256" "github.com/syncthing/syncthing/lib/sha256"
"github.com/syncthing/syncthing/lib/ur" "github.com/syncthing/syncthing/lib/ur"
_ "go.uber.org/automaxprocs"
) )
const maxRequestSize = 1 << 20 // 1 MiB const maxRequestSize = 1 << 20 // 1 MiB

View File

@ -15,10 +15,10 @@ import (
"strings" "strings"
"time" "time"
_ "github.com/syncthing/syncthing/lib/automaxprocs"
"github.com/syncthing/syncthing/lib/beacon" "github.com/syncthing/syncthing/lib/beacon"
"github.com/syncthing/syncthing/lib/discover" "github.com/syncthing/syncthing/lib/discover"
"github.com/syncthing/syncthing/lib/protocol" "github.com/syncthing/syncthing/lib/protocol"
_ "go.uber.org/automaxprocs"
) )
var ( var (

View File

@ -19,12 +19,12 @@ import (
"time" "time"
"github.com/prometheus/client_golang/prometheus/promhttp" "github.com/prometheus/client_golang/prometheus/promhttp"
_ "github.com/syncthing/syncthing/lib/automaxprocs"
"github.com/syncthing/syncthing/lib/build" "github.com/syncthing/syncthing/lib/build"
"github.com/syncthing/syncthing/lib/protocol" "github.com/syncthing/syncthing/lib/protocol"
"github.com/syncthing/syncthing/lib/tlsutil" "github.com/syncthing/syncthing/lib/tlsutil"
"github.com/syndtr/goleveldb/leveldb/opt" "github.com/syndtr/goleveldb/leveldb/opt"
"github.com/thejerf/suture/v4" "github.com/thejerf/suture/v4"
_ "go.uber.org/automaxprocs"
) )
const ( const (

View File

@ -15,7 +15,7 @@ import (
"os" "os"
"time" "time"
_ "go.uber.org/automaxprocs" _ "github.com/syncthing/syncthing/lib/automaxprocs"
) )
type event struct { type event struct {

View File

@ -13,9 +13,9 @@ import (
"os" "os"
"path/filepath" "path/filepath"
_ "github.com/syncthing/syncthing/lib/automaxprocs"
"github.com/syncthing/syncthing/lib/protocol" "github.com/syncthing/syncthing/lib/protocol"
"github.com/syncthing/syncthing/lib/scanner" "github.com/syncthing/syncthing/lib/scanner"
_ "go.uber.org/automaxprocs"
) )
func main() { func main() {

View File

@ -16,11 +16,11 @@ import (
"os" "os"
"time" "time"
_ "github.com/syncthing/syncthing/lib/automaxprocs"
"github.com/syncthing/syncthing/lib/config" "github.com/syncthing/syncthing/lib/config"
"github.com/syncthing/syncthing/lib/discover" "github.com/syncthing/syncthing/lib/discover"
"github.com/syncthing/syncthing/lib/events" "github.com/syncthing/syncthing/lib/events"
"github.com/syncthing/syncthing/lib/protocol" "github.com/syncthing/syncthing/lib/protocol"
_ "go.uber.org/automaxprocs"
) )
var timeout = 5 * time.Second var timeout = 5 * time.Second

View File

@ -12,9 +12,9 @@ import (
"fmt" "fmt"
"os" "os"
_ "github.com/syncthing/syncthing/lib/automaxprocs"
"github.com/syncthing/syncthing/lib/fs" "github.com/syncthing/syncthing/lib/fs"
"github.com/syncthing/syncthing/lib/ignore" "github.com/syncthing/syncthing/lib/ignore"
_ "go.uber.org/automaxprocs"
) )
func main() { func main() {

View File

@ -16,7 +16,7 @@ import (
"path/filepath" "path/filepath"
"time" "time"
_ "go.uber.org/automaxprocs" _ "github.com/syncthing/syncthing/lib/automaxprocs"
) )
func main() { func main() {
@ -45,7 +45,7 @@ func generateFiles(dir string, files, maxexp int, srcname string) error {
} }
p0 := filepath.Join(dir, string(n[0]), n[0:2]) p0 := filepath.Join(dir, string(n[0]), n[0:2])
err = os.MkdirAll(p0, 0755) err = os.MkdirAll(p0, 0o755)
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }
@ -84,7 +84,7 @@ func generateOneFile(fd io.ReadSeeker, p1 string, s int64) error {
return err return err
} }
os.Chmod(p1, os.FileMode(rand.Intn(0777)|0400)) os.Chmod(p1, os.FileMode(rand.Intn(0o777)|0o400))
t := time.Now().Add(-time.Duration(rand.Intn(30*86400)) * time.Second) t := time.Now().Add(-time.Duration(rand.Intn(30*86400)) * time.Second)
return os.Chtimes(p1, t, t) return os.Chtimes(p1, t, t)

View File

@ -26,13 +26,13 @@ import (
"github.com/prometheus/client_golang/prometheus/promhttp" "github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/syncthing/syncthing/cmd/strelaypoolsrv/auto" "github.com/syncthing/syncthing/cmd/strelaypoolsrv/auto"
"github.com/syncthing/syncthing/lib/assets" "github.com/syncthing/syncthing/lib/assets"
_ "github.com/syncthing/syncthing/lib/automaxprocs"
"github.com/syncthing/syncthing/lib/httpcache" "github.com/syncthing/syncthing/lib/httpcache"
"github.com/syncthing/syncthing/lib/protocol" "github.com/syncthing/syncthing/lib/protocol"
"github.com/syncthing/syncthing/lib/rand" "github.com/syncthing/syncthing/lib/rand"
"github.com/syncthing/syncthing/lib/relay/client" "github.com/syncthing/syncthing/lib/relay/client"
"github.com/syncthing/syncthing/lib/sync" "github.com/syncthing/syncthing/lib/sync"
"github.com/syncthing/syncthing/lib/tlsutil" "github.com/syncthing/syncthing/lib/tlsutil"
_ "go.uber.org/automaxprocs"
) )
type location struct { type location struct {

View File

@ -19,6 +19,7 @@ import (
"syscall" "syscall"
"time" "time"
_ "github.com/syncthing/syncthing/lib/automaxprocs"
"github.com/syncthing/syncthing/lib/build" "github.com/syncthing/syncthing/lib/build"
"github.com/syncthing/syncthing/lib/config" "github.com/syncthing/syncthing/lib/config"
"github.com/syncthing/syncthing/lib/events" "github.com/syncthing/syncthing/lib/events"
@ -29,7 +30,6 @@ import (
"github.com/syncthing/syncthing/lib/relay/protocol" "github.com/syncthing/syncthing/lib/relay/protocol"
"github.com/syncthing/syncthing/lib/tlsutil" "github.com/syncthing/syncthing/lib/tlsutil"
_ "github.com/syncthing/syncthing/lib/upnp" _ "github.com/syncthing/syncthing/lib/upnp"
_ "go.uber.org/automaxprocs"
"golang.org/x/time/rate" "golang.org/x/time/rate"
) )

View File

@ -14,10 +14,10 @@ import (
"path/filepath" "path/filepath"
"time" "time"
_ "github.com/syncthing/syncthing/lib/automaxprocs"
syncthingprotocol "github.com/syncthing/syncthing/lib/protocol" syncthingprotocol "github.com/syncthing/syncthing/lib/protocol"
"github.com/syncthing/syncthing/lib/relay/client" "github.com/syncthing/syncthing/lib/relay/client"
"github.com/syncthing/syncthing/lib/relay/protocol" "github.com/syncthing/syncthing/lib/relay/protocol"
_ "go.uber.org/automaxprocs"
) )
func main() { func main() {

View File

@ -12,9 +12,9 @@ import (
"log" "log"
"os" "os"
_ "github.com/syncthing/syncthing/lib/automaxprocs"
"github.com/syncthing/syncthing/lib/signature" "github.com/syncthing/syncthing/lib/signature"
"github.com/syncthing/syncthing/lib/upgrade" "github.com/syncthing/syncthing/lib/upgrade"
_ "go.uber.org/automaxprocs"
) )
func main() { func main() {

View File

@ -19,9 +19,9 @@ import (
"time" "time"
"github.com/alecthomas/kong" "github.com/alecthomas/kong"
_ "github.com/syncthing/syncthing/lib/automaxprocs"
"github.com/syncthing/syncthing/lib/httpcache" "github.com/syncthing/syncthing/lib/httpcache"
"github.com/syncthing/syncthing/lib/upgrade" "github.com/syncthing/syncthing/lib/upgrade"
_ "go.uber.org/automaxprocs"
) )
type cli struct { type cli struct {

View File

@ -26,8 +26,8 @@ import (
"sync/atomic" "sync/atomic"
"time" "time"
_ "github.com/syncthing/syncthing/lib/automaxprocs"
"github.com/syncthing/syncthing/lib/protocol" "github.com/syncthing/syncthing/lib/protocol"
_ "go.uber.org/automaxprocs"
) )
type result struct { type result struct {
@ -158,7 +158,7 @@ func saveCert(priv interface{}, derBytes []byte) {
os.Exit(1) os.Exit(1)
} }
keyOut, err := os.OpenFile("key.pem", os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0600) keyOut, err := os.OpenFile("key.pem", os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0o600)
if err != nil { if err != nil {
fmt.Println(err) fmt.Println(err)
os.Exit(1) os.Exit(1)

View File

@ -13,8 +13,8 @@ import (
"os" "os"
"time" "time"
_ "github.com/syncthing/syncthing/lib/automaxprocs"
"github.com/syncthing/syncthing/lib/sha256" "github.com/syncthing/syncthing/lib/sha256"
_ "go.uber.org/automaxprocs"
) )
func main() { func main() {

View File

@ -30,9 +30,9 @@ import (
"time" "time"
"github.com/alecthomas/kong" "github.com/alecthomas/kong"
_ "github.com/syncthing/syncthing/lib/automaxprocs"
"github.com/thejerf/suture/v4" "github.com/thejerf/suture/v4"
"github.com/willabides/kongplete" "github.com/willabides/kongplete"
_ "go.uber.org/automaxprocs"
"github.com/syncthing/syncthing/cmd/syncthing/cli" "github.com/syncthing/syncthing/cmd/syncthing/cli"
"github.com/syncthing/syncthing/cmd/syncthing/cmdutil" "github.com/syncthing/syncthing/cmd/syncthing/cmdutil"

View File

@ -13,7 +13,7 @@ import (
"github.com/alecthomas/kong" "github.com/alecthomas/kong"
"github.com/syncthing/syncthing/cmd/ursrv/aggregate" "github.com/syncthing/syncthing/cmd/ursrv/aggregate"
"github.com/syncthing/syncthing/cmd/ursrv/serve" "github.com/syncthing/syncthing/cmd/ursrv/serve"
_ "go.uber.org/automaxprocs" _ "github.com/syncthing/syncthing/lib/automaxprocs"
) )
type CLI struct { type CLI struct {

View File

@ -0,0 +1,15 @@
// Copyright (C) 2024 The Syncthing Authors.
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this file,
// You can obtain one at https://mozilla.org/MPL/2.0/.
package automaxprocs
import (
"go.uber.org/automaxprocs/maxprocs"
)
func init() {
maxprocs.Set()
}