Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

Commit

Permalink
avoid endless loop
Browse files Browse the repository at this point in the history
Signed-off-by: Florian Bacher <florian.bacher@dynatrace.com>
  • Loading branch information
bacherfl committed Sep 1, 2021
1 parent bc956ef commit 49b12dd
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions shipyard-controller/handler/sequence_migrator.go
Expand Up @@ -55,11 +55,12 @@ func (sm *SequenceMigrator) MigrateSequences() {

func (sm *SequenceMigrator) migrateSequencesOfProject(projectName string, wg *sync.WaitGroup) {
pageSize := int64(50)

nextPageKey := int64(0)
for {
rootEvents, err := sm.eventRepo.GetRootEvents(models.GetRootEventParams{
Project: projectName,
PageSize: pageSize,
NextPageKey: nextPageKey,
Project: projectName,
PageSize: pageSize,
})
if err != nil {
log.WithError(err).Errorf("could not retrieve root events of project %s", projectName)
Expand All @@ -76,6 +77,7 @@ func (sm *SequenceMigrator) migrateSequencesOfProject(projectName string, wg *sy
if rootEvents.NextPageKey == 0 {
break
}
nextPageKey = rootEvents.NextPageKey
}
wg.Done()
}
Expand Down

0 comments on commit 49b12dd

Please sign in to comment.