forked from TrueCloudLab/frostfs-node
[#125] ir: Set extra wallets on SIGHUP
Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
This commit is contained in:
parent
0624820909
commit
6f47c75e43
7 changed files with 61 additions and 36 deletions
|
@ -3,6 +3,7 @@ package alphabet
|
|||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/internal/logs"
|
||||
|
@ -45,7 +46,9 @@ type (
|
|||
|
||||
// Processor of events produced for alphabet contracts in the sidechain.
|
||||
Processor struct {
|
||||
parsedWallets []util.Uint160
|
||||
parsedWallets []util.Uint160
|
||||
// protects parsedWallets from concurrent change
|
||||
pwLock *sync.RWMutex
|
||||
log *logger.Logger
|
||||
pool *ants.Pool
|
||||
alphabetContracts Contracts
|
||||
|
@ -88,6 +91,7 @@ func New(p *Params) (*Processor, error) {
|
|||
|
||||
return &Processor{
|
||||
parsedWallets: p.ParsedWallets,
|
||||
pwLock: new(sync.RWMutex),
|
||||
log: p.Log,
|
||||
pool: pool,
|
||||
alphabetContracts: p.AlphabetContracts,
|
||||
|
@ -98,6 +102,12 @@ func New(p *Params) (*Processor, error) {
|
|||
}, nil
|
||||
}
|
||||
|
||||
func (ap *Processor) SetParsedWallets(parsedWallets []util.Uint160) {
|
||||
ap.pwLock.Lock()
|
||||
ap.parsedWallets = parsedWallets
|
||||
ap.pwLock.Unlock()
|
||||
}
|
||||
|
||||
// ListenerNotificationParsers for the 'event.Listener' event producer.
|
||||
func (ap *Processor) ListenerNotificationParsers() []event.NotificationParserInfo {
|
||||
return nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue