mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 22:07:31 +00:00
fix(eventstore): use decimal, correct mirror (#9906)
back port #9812, #9878, #9881, #9884 --------- Co-authored-by: Livio Spring <livio.a@gmail.com>
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package readmodel
|
||||
|
||||
import (
|
||||
"github.com/shopspring/decimal"
|
||||
|
||||
"github.com/zitadel/zitadel/internal/v2/eventstore"
|
||||
"github.com/zitadel/zitadel/internal/v2/system"
|
||||
"github.com/zitadel/zitadel/internal/v2/system/mirror"
|
||||
@@ -8,7 +10,7 @@ import (
|
||||
|
||||
type LastSuccessfulMirror struct {
|
||||
ID string
|
||||
Position float64
|
||||
Position decimal.Decimal
|
||||
source string
|
||||
}
|
||||
|
||||
@@ -34,6 +36,7 @@ func (p *LastSuccessfulMirror) Filter() *eventstore.Filter {
|
||||
),
|
||||
eventstore.FilterPagination(
|
||||
eventstore.Descending(),
|
||||
eventstore.Limit(1),
|
||||
),
|
||||
)
|
||||
}
|
||||
@@ -53,7 +56,7 @@ func (h *LastSuccessfulMirror) Reduce(events ...*eventstore.StorageEvent) (err e
|
||||
|
||||
func (h *LastSuccessfulMirror) reduceSucceeded(event *eventstore.StorageEvent) error {
|
||||
// if position is set we skip all older events
|
||||
if h.Position > 0 {
|
||||
if h.Position.GreaterThan(decimal.NewFromInt(0)) {
|
||||
return nil
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user