frostfs-node/pkg/innerring/processors/balance/handlers.go
Alex Vanin 20de74a505 Rename package name
Due to source code relocation from GitHub.

Signed-off-by: Alex Vanin <a.vanin@yadro.com>
2023-03-07 16:38:26 +03:00

25 lines
672 B
Go

package balance
import (
"encoding/hex"
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/event"
balanceEvent "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/event/balance"
"go.uber.org/zap"
)
func (bp *Processor) handleLock(ev event.Event) {
lock := ev.(balanceEvent.Lock)
bp.log.Info("notification",
zap.String("type", "lock"),
zap.String("value", hex.EncodeToString(lock.ID())))
// send an event to the worker pool
err := bp.pool.Submit(func() { bp.processLock(&lock) })
if err != nil {
// there system can be moved into controlled degradation stage
bp.log.Warn("balance worker pool drained",
zap.Int("capacity", bp.pool.Cap()))
}
}