mirror of
https://github.com/octoleo/restic.git
synced 2024-11-04 20:37:49 +00:00
parent
c9ab75a44c
commit
be00d91967
@ -2,18 +2,24 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
|
||||||
"runtime"
|
|
||||||
|
|
||||||
"github.com/jessevdk/go-flags"
|
"github.com/jessevdk/go-flags"
|
||||||
|
"os"
|
||||||
"restic"
|
"restic"
|
||||||
"restic/debug"
|
"restic/debug"
|
||||||
|
"runtime"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
// set GOMAXPROCS to number of CPUs
|
// set GOMAXPROCS to number of CPUs
|
||||||
|
if runtime.Version() < "go1.5" {
|
||||||
|
gomaxprocs := os.Getenv("GOMAXPROCS")
|
||||||
|
debug.Log("restic", "read GOMAXPROCS from env variable, value: %s", gomaxprocs)
|
||||||
|
if gomaxprocs == "" {
|
||||||
runtime.GOMAXPROCS(runtime.NumCPU())
|
runtime.GOMAXPROCS(runtime.NumCPU())
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
// defer profile.Start(profile.MemProfileRate(100000), profile.ProfilePath(".")).Stop()
|
// defer profile.Start(profile.MemProfileRate(100000), profile.ProfilePath(".")).Stop()
|
||||||
|
Loading…
Reference in New Issue
Block a user