mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-16 04:48:04 +00:00
29441ce4b6
* fix: filter failed events and current sequence correctly * fix failed events sorting column * feat: save last occurrence of failed event * fix failedEvents query and update sql statements * change sql statement to only create index * fix linting * fix linting * Update internal/query/failed_events.go Co-authored-by: Silvan <silvan.reusser@gmail.com> * update job name on test-docs to match the one from test-code Co-authored-by: Silvan <silvan.reusser@gmail.com>
45 lines
1.4 KiB
Go
45 lines
1.4 KiB
Go
package system
|
|
|
|
import (
|
|
"google.golang.org/protobuf/types/known/timestamppb"
|
|
|
|
"github.com/zitadel/zitadel/internal/query"
|
|
"github.com/zitadel/zitadel/internal/view/model"
|
|
system_pb "github.com/zitadel/zitadel/pkg/grpc/system"
|
|
)
|
|
|
|
func ViewsToPb(views []*model.View) []*system_pb.View {
|
|
v := make([]*system_pb.View, len(views))
|
|
for i, view := range views {
|
|
v[i] = ViewToPb(view)
|
|
}
|
|
return v
|
|
}
|
|
|
|
func ViewToPb(view *model.View) *system_pb.View {
|
|
return &system_pb.View{
|
|
Database: view.Database,
|
|
ViewName: view.ViewName,
|
|
LastSuccessfulSpoolerRun: timestamppb.New(view.LastSuccessfulSpoolerRun),
|
|
ProcessedSequence: view.CurrentSequence,
|
|
EventTimestamp: timestamppb.New(view.EventTimestamp),
|
|
}
|
|
}
|
|
|
|
func CurrentSequencesToPb(database string, currentSequences *query.CurrentSequences) []*system_pb.View {
|
|
v := make([]*system_pb.View, len(currentSequences.CurrentSequences))
|
|
for i, currentSequence := range currentSequences.CurrentSequences {
|
|
v[i] = CurrentSequenceToPb(database, currentSequence)
|
|
}
|
|
return v
|
|
}
|
|
|
|
func CurrentSequenceToPb(database string, currentSequence *query.CurrentSequence) *system_pb.View {
|
|
return &system_pb.View{
|
|
Database: database,
|
|
ViewName: currentSequence.ProjectionName,
|
|
ProcessedSequence: currentSequence.CurrentSequence,
|
|
LastSuccessfulSpoolerRun: timestamppb.New(currentSequence.Timestamp),
|
|
}
|
|
}
|