fix(notifications): bring back legacy notification handling (#9015)

# Which Problems Are Solved

There are some problems related to the use of CockroachDB with the new
notification handling (#8931).
See #9002 for details.

# How the Problems Are Solved

- Brought back the previous notification handler as legacy mode.
- Added a configuration to choose between legacy mode and new parallel
workers.
  - Enabled legacy mode by default to prevent issues.

# Additional Changes

None

# Additional Context

- closes https://github.com/zitadel/zitadel/issues/9002
- relates to #8931
This commit is contained in:
Livio Spring
2024-12-06 10:56:19 +01:00
committed by GitHub
parent 71d381b5e7
commit 7a3ae8f499
23 changed files with 2870 additions and 1 deletions

View File

@@ -43,6 +43,7 @@ type NotificationWorker struct {
}
type WorkerConfig struct {
LegacyEnabled bool
Workers uint8
BulkLimit uint16
RequeueEvery time.Duration
@@ -97,6 +98,9 @@ func NewNotificationWorker(
}
func (w *NotificationWorker) Start(ctx context.Context) {
if w.config.LegacyEnabled {
return
}
for i := 0; i < int(w.config.Workers); i++ {
go w.schedule(ctx, i, false)
}