2020-10-12 10:17:40 +00:00
|
|
|
package alphabet
|
|
|
|
|
|
|
|
import (
|
2023-04-12 14:35:10 +00:00
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-node/internal/logs"
|
2023-03-07 13:38:26 +00:00
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/innerring/timers"
|
|
|
|
"git.frostfs.info/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)
|
2023-04-12 14:35:10 +00:00
|
|
|
ap.log.Info(logs.AlphabetTick, 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
|
2023-04-12 14:35:10 +00:00
|
|
|
ap.log.Warn(logs.AlphabetAlphabetProcessorWorkerPoolDrained,
|
2021-09-08 08:28:41 +00:00
|
|
|
zap.Int("capacity", ap.pool.Cap()))
|
2020-10-12 10:17:40 +00:00
|
|
|
}
|
|
|
|
}
|