mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 08:57:35 +00:00
feat: save last occurrence of failed events and fix instance filtering (#4710)
* 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>
This commit is contained in:
@@ -135,7 +135,7 @@ func (s *spooledHandler) awaitError(cancel func(), errs chan error, workerID str
|
||||
select {
|
||||
case err := <-errs:
|
||||
cancel()
|
||||
logging.Log("SPOOL-OT8di").OnError(err).WithField("view", s.ViewModel()).WithField("worker", workerID).Debug("load canceled")
|
||||
logging.OnError(err).WithField("view", s.ViewModel()).WithField("worker", workerID).Debug("load canceled")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -216,6 +216,7 @@ func HandleError(event *models.Event, failedErr error,
|
||||
failedEvent.FailureCount++
|
||||
failedEvent.ErrMsg = failedErr.Error()
|
||||
failedEvent.InstanceID = event.InstanceID
|
||||
failedEvent.LastFailed = time.Now()
|
||||
err = processFailedEvent(failedEvent)
|
||||
if err != nil {
|
||||
return err
|
||||
|
@@ -17,6 +17,10 @@ import (
|
||||
"github.com/zitadel/zitadel/internal/view/repository"
|
||||
)
|
||||
|
||||
var (
|
||||
testNow = time.Now()
|
||||
)
|
||||
|
||||
type testHandler struct {
|
||||
cycleDuration time.Duration
|
||||
processSleep time.Duration
|
||||
@@ -429,6 +433,7 @@ func TestHandleError(t *testing.T) {
|
||||
FailureCount: 6,
|
||||
ViewName: "super.table",
|
||||
InstanceID: instanceID,
|
||||
LastFailed: testNow,
|
||||
}, nil
|
||||
},
|
||||
errorCountUntilSkip: 5,
|
||||
@@ -449,6 +454,7 @@ func TestHandleError(t *testing.T) {
|
||||
FailureCount: 5,
|
||||
ViewName: "super.table",
|
||||
InstanceID: instanceID,
|
||||
LastFailed: testNow,
|
||||
}, nil
|
||||
},
|
||||
errorCountUntilSkip: 6,
|
||||
@@ -469,6 +475,7 @@ func TestHandleError(t *testing.T) {
|
||||
FailureCount: 3,
|
||||
ViewName: "super.table",
|
||||
InstanceID: instanceID,
|
||||
LastFailed: testNow,
|
||||
}, nil
|
||||
},
|
||||
errorCountUntilSkip: 5,
|
||||
|
Reference in New Issue
Block a user