Use templating on counter name

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2020-12-26 00:31:49 +01:00
parent 58e984a4f4
commit 87f8fd84e2
Signed by: luzifer
GPG key ID: 0066F03ED215AD7D

View file

@ -11,13 +11,18 @@ func init() {
return nil return nil
} }
counterName, err := formatMessage(*r.Counter, m, ruleDef, nil)
if err != nil {
return errors.Wrap(err, "preparing response")
}
var counterStep int64 = 1 var counterStep int64 = 1
if r.CounterStep != nil { if r.CounterStep != nil {
counterStep = *r.CounterStep counterStep = *r.CounterStep
} }
return errors.Wrap( return errors.Wrap(
store.UpdateCounter(*r.Counter, counterStep, false), store.UpdateCounter(counterName, counterStep, false),
"update counter", "update counter",
) )
}) })