aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/utils/flags.go
diff options
context:
space:
mode:
authorRicardo Domingos <ricardohsd@gmail.com>2018-01-12 04:55:21 +0800
committerPéter Szilágyi <peterke@gmail.com>2018-01-12 04:55:21 +0800
commit56152b31ac251d1cc68fcddbdad159ba5234c415 (patch)
tree0b3bca4a858593df684a20a37b5598a483f4b17f /cmd/utils/flags.go
parent023769d9d48fab92c1d4d7d97c0a08ae3ef2cdca (diff)
downloadgo-tangerine-56152b31ac251d1cc68fcddbdad159ba5234c415.tar
go-tangerine-56152b31ac251d1cc68fcddbdad159ba5234c415.tar.gz
go-tangerine-56152b31ac251d1cc68fcddbdad159ba5234c415.tar.bz2
go-tangerine-56152b31ac251d1cc68fcddbdad159ba5234c415.tar.lz
go-tangerine-56152b31ac251d1cc68fcddbdad159ba5234c415.tar.xz
go-tangerine-56152b31ac251d1cc68fcddbdad159ba5234c415.tar.zst
go-tangerine-56152b31ac251d1cc68fcddbdad159ba5234c415.zip
common/fdlimit: Move fdlimit files to separate package (#15850)
* common/fdlimit: Move fdlimit files to separate package When go-ethereum is used as a library the calling program need to set the FD limit. This commit extract fdlimit files to a separate package so it can be used outside of go-ethereum. * common/fdlimit: Remove FdLimit from functions signature * common/fdlimit: Rename fdlimit functions
Diffstat (limited to 'cmd/utils/flags.go')
-rw-r--r--cmd/utils/flags.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go
index edf3dc2c2..94ab64c2e 100644
--- a/cmd/utils/flags.go
+++ b/cmd/utils/flags.go
@@ -31,6 +31,7 @@ import (
"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/accounts/keystore"
"github.com/ethereum/go-ethereum/common"
+ "github.com/ethereum/go-ethereum/common/fdlimit"
"github.com/ethereum/go-ethereum/consensus"
"github.com/ethereum/go-ethereum/consensus/clique"
"github.com/ethereum/go-ethereum/consensus/ethash"
@@ -721,10 +722,10 @@ func setIPC(ctx *cli.Context, cfg *node.Config) {
// makeDatabaseHandles raises out the number of allowed file handles per process
// for Geth and returns half of the allowance to assign to the database.
func makeDatabaseHandles() int {
- if err := raiseFdLimit(2048); err != nil {
+ if err := fdlimit.Raise(2048); err != nil {
Fatalf("Failed to raise file descriptor allowance: %v", err)
}
- limit, err := getFdLimit()
+ limit, err := fdlimit.Current()
if err != nil {
Fatalf("Failed to retrieve file descriptor allowance: %v", err)
}