mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 07:47:32 +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:
@@ -2,8 +2,8 @@ package view
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/caos/zitadel/internal/eventstore/models"
|
||||
proj_model "github.com/caos/zitadel/internal/project/model"
|
||||
"github.com/caos/zitadel/internal/project/repository/view"
|
||||
"github.com/caos/zitadel/internal/project/repository/view/model"
|
||||
@@ -34,28 +34,28 @@ func (v *View) SearchApplications(request *proj_model.ApplicationSearchRequest)
|
||||
return view.SearchApplications(v.Db, applicationTable, request)
|
||||
}
|
||||
|
||||
func (v *View) PutApplication(project *model.ApplicationView, eventTimestamp time.Time) error {
|
||||
func (v *View) PutApplication(project *model.ApplicationView, event *models.Event) error {
|
||||
err := view.PutApplication(v.Db, applicationTable, project)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return v.ProcessedApplicationSequence(project.Sequence, eventTimestamp)
|
||||
return v.ProcessedApplicationSequence(event)
|
||||
}
|
||||
|
||||
func (v *View) DeleteApplication(appID string, eventSequence uint64, eventTimestamp time.Time) error {
|
||||
func (v *View) DeleteApplication(appID string, event *models.Event) error {
|
||||
err := view.DeleteApplication(v.Db, applicationTable, appID)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
return v.ProcessedApplicationSequence(eventSequence, eventTimestamp)
|
||||
return v.ProcessedApplicationSequence(event)
|
||||
}
|
||||
|
||||
func (v *View) GetLatestApplicationSequence() (*repository.CurrentSequence, error) {
|
||||
return v.latestSequence(applicationTable)
|
||||
func (v *View) GetLatestApplicationSequence(aggregateType string) (*repository.CurrentSequence, error) {
|
||||
return v.latestSequence(applicationTable, aggregateType)
|
||||
}
|
||||
|
||||
func (v *View) ProcessedApplicationSequence(eventSequence uint64, eventTimestamp time.Time) error {
|
||||
return v.saveCurrentSequence(applicationTable, eventSequence, eventTimestamp)
|
||||
func (v *View) ProcessedApplicationSequence(event *models.Event) error {
|
||||
return v.saveCurrentSequence(applicationTable, event)
|
||||
}
|
||||
|
||||
func (v *View) UpdateApplicationSpoolerRunTimestamp() error {
|
||||
|
Reference in New Issue
Block a user