mirror of
https://github.com/zitadel/zitadel.git
synced 2025-02-28 20:17:23 +00:00

# Which Problems Are Solved The recently introduced notification queue have potential race conditions. # How the Problems Are Solved Current code is refactored to use the queue package, which is safe in regards of concurrency. # Additional Changes - the queue is included in startup - improved code quality of queue # Additional Context - closes https://github.com/zitadel/zitadel/issues/9278
29 lines
627 B
Go
29 lines
627 B
Go
package setup
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/zitadel/zitadel/internal/database"
|
|
"github.com/zitadel/zitadel/internal/eventstore"
|
|
"github.com/zitadel/zitadel/internal/queue"
|
|
)
|
|
|
|
type RiverMigrateRepeatable struct {
|
|
client *database.DB
|
|
}
|
|
|
|
func (mig *RiverMigrateRepeatable) Execute(ctx context.Context, _ eventstore.Event) error {
|
|
if mig.client.Type() != "postgres" {
|
|
return nil
|
|
}
|
|
return queue.NewMigrator(mig.client).Execute(ctx)
|
|
}
|
|
|
|
func (mig *RiverMigrateRepeatable) String() string {
|
|
return "repeatable_migrate_river"
|
|
}
|
|
|
|
func (f *RiverMigrateRepeatable) Check(lastRun map[string]interface{}) bool {
|
|
return true
|
|
}
|