mirror of
https://github.com/zitadel/zitadel.git
synced 2025-10-21 11:49:14 +00:00
fix(event handling): use internal pubsub for view update (#1118)
* start sub * start implement subsciptions * start subscription * implementation for member done * admin done * fix: tests * extend handlers * prepary notification * no errors in adminapi * changed current sequence in all packages * ignore mocks * works * subscriptions as singleton * tests * refactor: rename function scope var
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
package view
|
||||
|
||||
import (
|
||||
"github.com/caos/zitadel/internal/eventstore/models"
|
||||
"github.com/caos/zitadel/internal/org/model"
|
||||
org_view "github.com/caos/zitadel/internal/org/repository/view"
|
||||
org_model "github.com/caos/zitadel/internal/org/repository/view/model"
|
||||
"github.com/caos/zitadel/internal/view/repository"
|
||||
"time"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -24,12 +24,12 @@ func (v *View) SearchOrgs(req *model.OrgSearchRequest) ([]*org_model.OrgView, ui
|
||||
return org_view.SearchOrgs(v.Db, orgTable, req)
|
||||
}
|
||||
|
||||
func (v *View) PutOrg(org *org_model.OrgView, eventTimestamp time.Time) error {
|
||||
func (v *View) PutOrg(org *org_model.OrgView, event *models.Event) error {
|
||||
err := org_view.PutOrg(v.Db, orgTable, org)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return v.ProcessedOrgSequence(org.Sequence, eventTimestamp)
|
||||
return v.ProcessedOrgSequence(event)
|
||||
}
|
||||
|
||||
func (v *View) GetLatestOrgFailedEvent(sequence uint64) (*repository.FailedEvent, error) {
|
||||
@@ -44,10 +44,10 @@ func (v *View) UpdateOrgSpoolerRunTimestamp() error {
|
||||
return v.updateSpoolerRunSequence(orgTable)
|
||||
}
|
||||
|
||||
func (v *View) GetLatestOrgSequence() (*repository.CurrentSequence, error) {
|
||||
return v.latestSequence(orgTable)
|
||||
func (v *View) GetLatestOrgSequence(aggregateType string) (*repository.CurrentSequence, error) {
|
||||
return v.latestSequence(orgTable, aggregateType)
|
||||
}
|
||||
|
||||
func (v *View) ProcessedOrgSequence(eventSequence uint64, eventTimestamp time.Time) error {
|
||||
return v.saveCurrentSequence(orgTable, eventSequence, eventTimestamp)
|
||||
func (v *View) ProcessedOrgSequence(event *models.Event) error {
|
||||
return v.saveCurrentSequence(orgTable, event)
|
||||
}
|
||||
|
Reference in New Issue
Block a user