mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-12-05 18:31:37 +01:00
server+lncfg: make max in-mem tasks configurable
Add a `MaxTasksInMemQueue` field to the `WtClient` config so that users can change the default if they please.
This commit is contained in:
@@ -23,6 +23,10 @@ type WtClient struct {
|
|||||||
// before sending the DeleteSession message to the tower server.
|
// before sending the DeleteSession message to the tower server.
|
||||||
SessionCloseRange uint32 `long:"session-close-range" description:"The range over which to choose a random number of blocks to wait after the last channel of a session is closed before sending the DeleteSession message to the tower server. Set to 1 for no delay."`
|
SessionCloseRange uint32 `long:"session-close-range" description:"The range over which to choose a random number of blocks to wait after the last channel of a session is closed before sending the DeleteSession message to the tower server. Set to 1 for no delay."`
|
||||||
|
|
||||||
|
// MaxTasksInMemQueue is the maximum number of back-up tasks that should
|
||||||
|
// be queued in memory before overflowing to disk.
|
||||||
|
MaxTasksInMemQueue uint64 `long:"max-tasks-in-mem-queue" description:"The maximum number of updates that should be queued in memory before overflowing to disk."`
|
||||||
|
|
||||||
// MaxUpdates is the maximum number of updates to be backed up in a
|
// MaxUpdates is the maximum number of updates to be backed up in a
|
||||||
// single tower sessions.
|
// single tower sessions.
|
||||||
MaxUpdates uint16 `long:"max-updates" description:"The maximum number of updates to be backed up in a single session."`
|
MaxUpdates uint16 `long:"max-updates" description:"The maximum number of updates to be backed up in a single session."`
|
||||||
|
|||||||
@@ -1007,6 +1007,10 @@ litecoin.node=ltcd
|
|||||||
; The maximum number of updates to include in a tower session.
|
; The maximum number of updates to include in a tower session.
|
||||||
; wtclient.max-updates=1024
|
; wtclient.max-updates=1024
|
||||||
|
|
||||||
|
; The maximum number of back-up tasks that should be queued in memory before
|
||||||
|
; overflowing to disk.
|
||||||
|
; wtclient.max-tasks-in-mem-queue=2000
|
||||||
|
|
||||||
[healthcheck]
|
[healthcheck]
|
||||||
|
|
||||||
; The number of times we should attempt to query our chain backend before
|
; The number of times we should attempt to query our chain backend before
|
||||||
|
|||||||
@@ -1516,6 +1516,11 @@ func newServer(cfg *Config, listenAddrs []net.Addr,
|
|||||||
sessionCloseRange = cfg.WtClient.SessionCloseRange
|
sessionCloseRange = cfg.WtClient.SessionCloseRange
|
||||||
}
|
}
|
||||||
|
|
||||||
|
maxTasksInMemQueue := uint64(wtclient.DefaultMaxTasksInMemQueue)
|
||||||
|
if cfg.WtClient.MaxTasksInMemQueue != 0 {
|
||||||
|
maxTasksInMemQueue = cfg.WtClient.MaxTasksInMemQueue
|
||||||
|
}
|
||||||
|
|
||||||
if err := policy.Validate(); err != nil {
|
if err := policy.Validate(); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -1579,7 +1584,7 @@ func newServer(cfg *Config, listenAddrs []net.Addr,
|
|||||||
MinBackoff: 10 * time.Second,
|
MinBackoff: 10 * time.Second,
|
||||||
MaxBackoff: 5 * time.Minute,
|
MaxBackoff: 5 * time.Minute,
|
||||||
ForceQuitDelay: wtclient.DefaultForceQuitDelay,
|
ForceQuitDelay: wtclient.DefaultForceQuitDelay,
|
||||||
MaxTasksInMemQueue: wtclient.DefaultMaxTasksInMemQueue,
|
MaxTasksInMemQueue: maxTasksInMemQueue,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@@ -1613,7 +1618,7 @@ func newServer(cfg *Config, listenAddrs []net.Addr,
|
|||||||
MinBackoff: 10 * time.Second,
|
MinBackoff: 10 * time.Second,
|
||||||
MaxBackoff: 5 * time.Minute,
|
MaxBackoff: 5 * time.Minute,
|
||||||
ForceQuitDelay: wtclient.DefaultForceQuitDelay,
|
ForceQuitDelay: wtclient.DefaultForceQuitDelay,
|
||||||
MaxTasksInMemQueue: wtclient.DefaultMaxTasksInMemQueue,
|
MaxTasksInMemQueue: maxTasksInMemQueue,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|||||||
Reference in New Issue
Block a user