fix: use current sequence for refetching of events (#5772)

* fix: use current sequence for refetching of events

* fix: use client ids
This commit is contained in:
Livio Spring
2023-04-28 16:28:13 +02:00
committed by GitHub
parent c8c5cf3c5f
commit 458a383de2
28 changed files with 273 additions and 107 deletions

View File

@@ -1,12 +1,17 @@
package view
import (
"context"
"github.com/jinzhu/gorm"
"github.com/zitadel/zitadel/internal/api/call"
"github.com/zitadel/zitadel/internal/database"
)
type View struct {
Db *gorm.DB
Db *gorm.DB
client *database.DB
}
func StartView(sqlClient *database.DB) (*View, error) {
@@ -15,10 +20,15 @@ func StartView(sqlClient *database.DB) (*View, error) {
return nil, err
}
return &View{
Db: gorm,
Db: gorm,
client: sqlClient,
}, nil
}
func (v *View) Health() (err error) {
return v.Db.DB().Ping()
}
func (v *View) TimeTravel(ctx context.Context, tableName string) string {
return tableName + v.client.Timetravel(call.Took(ctx))
}