mirror of
https://github.com/zitadel/zitadel.git
synced 2025-01-10 09:43:41 +00:00
review
This commit is contained in:
parent
2a1149a67a
commit
1d64cc6129
@ -2,6 +2,8 @@ package projection
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"strconv"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/zitadel/zitadel/internal/eventstore"
|
"github.com/zitadel/zitadel/internal/eventstore"
|
||||||
"github.com/zitadel/zitadel/internal/eventstore/handler"
|
"github.com/zitadel/zitadel/internal/eventstore/handler"
|
||||||
@ -286,5 +288,11 @@ func (p *milestoneProjection) reduceAppConfigAdded(event eventstore.Event, clien
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (p *milestoneProjection) isSystemEvent(event eventstore.Event) bool {
|
func (p *milestoneProjection) isSystemEvent(event eventstore.Event) bool {
|
||||||
return event.EditorUser() == "" || event.EditorService() == "" || event.EditorService() == "SYSTEM"
|
if _, err := strconv.Atoi(event.EditorUser()); err == nil {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
lowerEditorService := strings.ToLower(event.EditorService())
|
||||||
|
return lowerEditorService == "" ||
|
||||||
|
lowerEditorService == "system" ||
|
||||||
|
lowerEditorService == "system-api"
|
||||||
}
|
}
|
||||||
|
@ -338,7 +338,6 @@ func (q *Queries) GetUserByID(ctx context.Context, shouldTriggerBulk bool, userI
|
|||||||
defer func() { span.EndWithError(err) }()
|
defer func() { span.EndWithError(err) }()
|
||||||
|
|
||||||
if shouldTriggerBulk {
|
if shouldTriggerBulk {
|
||||||
// TODO: Why are these errors not handled?
|
|
||||||
projection.UserProjection.Trigger(ctx)
|
projection.UserProjection.Trigger(ctx)
|
||||||
projection.LoginNameProjection.Trigger(ctx)
|
projection.LoginNameProjection.Trigger(ctx)
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
// Package pseudo contains virtual events, that are not stored in the eventstore.
|
||||||
package pseudo
|
package pseudo
|
||||||
|
|
||||||
import (
|
import (
|
||||||
@ -20,6 +21,8 @@ type ScheduledEvent struct {
|
|||||||
InstanceIDs []string `json:"-"`
|
InstanceIDs []string `json:"-"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NewScheduledEvent returns an event that can be processed by event handlers like any other event.
|
||||||
|
// It receives the current timestamp and an ID list of instances that are active and should be processed.
|
||||||
func NewScheduledEvent(
|
func NewScheduledEvent(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
timestamp time.Time,
|
timestamp time.Time,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user