2020-10-12 10:17:40 +00:00
|
|
|
package alphabet
|
|
|
|
|
|
|
|
import (
|
2022-12-23 17:35:35 +00:00
|
|
|
"github.com/TrueCloudLab/frostfs-node/pkg/innerring/timers"
|
|
|
|
"github.com/TrueCloudLab/frostfs-node/pkg/morph/event"
|
2020-10-12 10:17:40 +00:00
|
|
|
"go.uber.org/zap"
|
|
|
|
)
|
|
|
|
|
2021-09-08 08:28:41 +00:00
|
|
|
func (ap *Processor) HandleGasEmission(ev event.Event) {
|
2020-10-12 10:17:40 +00:00
|
|
|
_ = ev.(timers.NewAlphabetEmitTick)
|
2021-09-08 08:28:41 +00:00
|
|
|
ap.log.Info("tick", zap.String("type", "alphabet gas emit"))
|
2020-10-12 10:17:40 +00:00
|
|
|
|
|
|
|
// send event to the worker pool
|
|
|
|
|
2021-09-08 08:28:41 +00:00
|
|
|
err := ap.pool.Submit(func() { ap.processEmit() })
|
2020-10-12 10:17:40 +00:00
|
|
|
if err != nil {
|
|
|
|
// there system can be moved into controlled degradation stage
|
2021-09-08 08:28:41 +00:00
|
|
|
ap.log.Warn("alphabet processor worker pool drained",
|
|
|
|
zap.Int("capacity", ap.pool.Cap()))
|
2020-10-12 10:17:40 +00:00
|
|
|
}
|
|
|
|
}
|