mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 21:07:31 +00:00
fix: env.json caching, readiness and unique lockerIDs (#3596)
* fix: readiness check * disable cache for env.json * always generate unique lockerID * fix tests
This commit is contained in:
@@ -22,8 +22,6 @@ const (
|
||||
InstanceColumnConsoleID = "console_client_id"
|
||||
InstanceColumnConsoleAppID = "console_app_id"
|
||||
InstanceColumnSequence = "sequence"
|
||||
InstanceColumnSetUpStarted = "setup_started"
|
||||
InstanceColumnSetUpDone = "setup_done"
|
||||
InstanceColumnDefaultLanguage = "default_language"
|
||||
)
|
||||
|
||||
@@ -46,8 +44,6 @@ func NewInstanceProjection(ctx context.Context, config crdb.StatementHandlerConf
|
||||
crdb.NewColumn(InstanceColumnConsoleID, crdb.ColumnTypeText, crdb.Default("")),
|
||||
crdb.NewColumn(InstanceColumnConsoleAppID, crdb.ColumnTypeText, crdb.Default("")),
|
||||
crdb.NewColumn(InstanceColumnSequence, crdb.ColumnTypeInt64),
|
||||
crdb.NewColumn(InstanceColumnSetUpStarted, crdb.ColumnTypeInt64, crdb.Default(0)),
|
||||
crdb.NewColumn(InstanceColumnSetUpDone, crdb.ColumnTypeInt64, crdb.Default(0)),
|
||||
crdb.NewColumn(InstanceColumnDefaultLanguage, crdb.ColumnTypeText, crdb.Default("")),
|
||||
},
|
||||
crdb.NewPrimaryKey(InstanceColumnID),
|
||||
@@ -82,14 +78,6 @@ func (p *InstanceProjection) reducers() []handler.AggregateReducer {
|
||||
Event: instance.DefaultLanguageSetEventType,
|
||||
Reduce: p.reduceDefaultLanguageSet,
|
||||
},
|
||||
{
|
||||
Event: instance.SetupStartedEventType,
|
||||
Reduce: p.reduceSetupEvent,
|
||||
},
|
||||
{
|
||||
Event: instance.SetupDoneEventType,
|
||||
Reduce: p.reduceSetupEvent,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -184,24 +172,3 @@ func (p *InstanceProjection) reduceDefaultLanguageSet(event eventstore.Event) (*
|
||||
},
|
||||
), nil
|
||||
}
|
||||
|
||||
func (p *InstanceProjection) reduceSetupEvent(event eventstore.Event) (*handler.Statement, error) {
|
||||
e, ok := event.(*instance.SetupStepEvent)
|
||||
if !ok {
|
||||
return nil, errors.ThrowInvalidArgumentf(nil, "HANDL-d9nfw", "reduce.wrong.event.type %v", []eventstore.EventType{instance.SetupDoneEventType, instance.SetupStartedEventType})
|
||||
}
|
||||
columns := []handler.Column{
|
||||
handler.NewCol(InstanceColumnID, e.Aggregate().InstanceID),
|
||||
handler.NewCol(InstanceColumnChangeDate, e.CreationDate()),
|
||||
handler.NewCol(InstanceColumnSequence, e.Sequence()),
|
||||
}
|
||||
if e.EventType == instance.SetupStartedEventType {
|
||||
columns = append(columns, handler.NewCol(InstanceColumnSetUpStarted, e.Step))
|
||||
} else {
|
||||
columns = append(columns, handler.NewCol(InstanceColumnSetUpDone, e.Step))
|
||||
}
|
||||
return crdb.NewUpsertStatement(
|
||||
e,
|
||||
columns,
|
||||
), nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user