config: fix duration parameter types
These parameters denote seconds and are thus unitless integers, not durations. Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
63c939b9fa
commit
7fa6c8dcf6
2 changed files with 8 additions and 10 deletions
|
@ -1,8 +1,6 @@
|
||||||
package config
|
package config
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/nspcc-dev/neo-go/pkg/core/storage"
|
"github.com/nspcc-dev/neo-go/pkg/core/storage"
|
||||||
"github.com/nspcc-dev/neo-go/pkg/network/metrics"
|
"github.com/nspcc-dev/neo-go/pkg/network/metrics"
|
||||||
"github.com/nspcc-dev/neo-go/pkg/rpc"
|
"github.com/nspcc-dev/neo-go/pkg/rpc"
|
||||||
|
@ -14,16 +12,16 @@ type ApplicationConfiguration struct {
|
||||||
AnnouncedNodePort uint16 `yaml:"AnnouncedPort"`
|
AnnouncedNodePort uint16 `yaml:"AnnouncedPort"`
|
||||||
AttemptConnPeers int `yaml:"AttemptConnPeers"`
|
AttemptConnPeers int `yaml:"AttemptConnPeers"`
|
||||||
DBConfiguration storage.DBConfiguration `yaml:"DBConfiguration"`
|
DBConfiguration storage.DBConfiguration `yaml:"DBConfiguration"`
|
||||||
DialTimeout time.Duration `yaml:"DialTimeout"`
|
DialTimeout int64 `yaml:"DialTimeout"`
|
||||||
LogPath string `yaml:"LogPath"`
|
LogPath string `yaml:"LogPath"`
|
||||||
MaxPeers int `yaml:"MaxPeers"`
|
MaxPeers int `yaml:"MaxPeers"`
|
||||||
MinPeers int `yaml:"MinPeers"`
|
MinPeers int `yaml:"MinPeers"`
|
||||||
NodePort uint16 `yaml:"NodePort"`
|
NodePort uint16 `yaml:"NodePort"`
|
||||||
PingInterval time.Duration `yaml:"PingInterval"`
|
PingInterval int64 `yaml:"PingInterval"`
|
||||||
PingTimeout time.Duration `yaml:"PingTimeout"`
|
PingTimeout int64 `yaml:"PingTimeout"`
|
||||||
Pprof metrics.Config `yaml:"Pprof"`
|
Pprof metrics.Config `yaml:"Pprof"`
|
||||||
Prometheus metrics.Config `yaml:"Prometheus"`
|
Prometheus metrics.Config `yaml:"Prometheus"`
|
||||||
ProtoTickInterval time.Duration `yaml:"ProtoTickInterval"`
|
ProtoTickInterval int64 `yaml:"ProtoTickInterval"`
|
||||||
Relay bool `yaml:"Relay"`
|
Relay bool `yaml:"Relay"`
|
||||||
RPC rpc.Config `yaml:"RPC"`
|
RPC rpc.Config `yaml:"RPC"`
|
||||||
UnlockWallet Wallet `yaml:"UnlockWallet"`
|
UnlockWallet Wallet `yaml:"UnlockWallet"`
|
||||||
|
|
|
@ -103,10 +103,10 @@ func NewServerConfig(cfg config.Config) ServerConfig {
|
||||||
Net: protoConfig.Magic,
|
Net: protoConfig.Magic,
|
||||||
Relay: appConfig.Relay,
|
Relay: appConfig.Relay,
|
||||||
Seeds: protoConfig.SeedList,
|
Seeds: protoConfig.SeedList,
|
||||||
DialTimeout: appConfig.DialTimeout * time.Second,
|
DialTimeout: time.Duration(appConfig.DialTimeout) * time.Second,
|
||||||
ProtoTickInterval: appConfig.ProtoTickInterval * time.Second,
|
ProtoTickInterval: time.Duration(appConfig.ProtoTickInterval) * time.Second,
|
||||||
PingInterval: appConfig.PingInterval * time.Second,
|
PingInterval: time.Duration(appConfig.PingInterval) * time.Second,
|
||||||
PingTimeout: appConfig.PingTimeout * time.Second,
|
PingTimeout: time.Duration(appConfig.PingTimeout) * time.Second,
|
||||||
MaxPeers: appConfig.MaxPeers,
|
MaxPeers: appConfig.MaxPeers,
|
||||||
AttemptConnPeers: appConfig.AttemptConnPeers,
|
AttemptConnPeers: appConfig.AttemptConnPeers,
|
||||||
MinPeers: appConfig.MinPeers,
|
MinPeers: appConfig.MinPeers,
|
||||||
|
|
Loading…
Reference in a new issue