Skip to content

Commit

Permalink
feat(redis_migration): log if there are still pending orchestrations/…
Browse files Browse the repository at this point in the history
…pipelines (#1626)
  • Loading branch information
asher authored Sep 19, 2017
1 parent c57a06a commit f05e602
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,20 @@ class MultiRedisOrchestrationMigrationNotificationAgent extends AbstractPollingN

allApplications.eachWithIndex { Application application, int index ->
def applicationName = application.name.toLowerCase()
def migratableOrchestrations = executionRepositoryPrevious
def unmigratedOrchestrations = executionRepositoryPrevious
.retrieveOrchestrationsForApplication(applicationName, executionCriteria)
.filter({ orchestration -> orchestration.status.isComplete() && !previouslyMigratedOrchestrationIds.contains(orchestration.id) })
.filter({ orchestration -> !previouslyMigratedOrchestrationIds.contains(orchestration.id) })
.toList()
.toBlocking()
.single()

def migratableOrchestrations = unmigratedOrchestrations.findAll { it.status.isComplete() }
def pendingOrchestrations = unmigratedOrchestrations.findAll { !it.status.isComplete() }

if (migratableOrchestrations.isEmpty()) {
if (!pendingOrchestrations.isEmpty()) {
log.info("${pendingOrchestrations.size()} orchestrations yet to complete ${applicationName}) [${index}/${allApplications.size()}]")
}
return
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,20 @@ class MultiRedisPipelineMigrationNotificationAgent extends AbstractPollingNotifi
log.info("Found ${allPipelineConfigIds.size()} pipeline configs")

allPipelineConfigIds.eachWithIndex { String pipelineConfigId, int index ->
def migratablePipelines = executionRepositoryPrevious
def unmigratedPipelines = executionRepositoryPrevious
.retrievePipelinesForPipelineConfigId(pipelineConfigId, executionCriteria)
.filter({ pipeline -> pipeline.status.isComplete() && !previouslyMigratedPipelineIds.contains(pipeline.id) })
.filter({ pipeline -> !previouslyMigratedPipelineIds.contains(pipeline.id) })
.toList()
.toBlocking()
.single()

def migratablePipelines = unmigratedPipelines.findAll { it.status.isComplete() }
def pendingPipelines = unmigratedPipelines.findAll { !it.status.isComplete() }

if (migratablePipelines.isEmpty()) {
if (!pendingPipelines.isEmpty()) {
log.info("${pendingPipelines.size()} pipelines yet to complete (${pipelineConfigId}) [${index}/${allPipelineConfigIds.size()}]")
}
return
}

Expand Down

0 comments on commit f05e602

Please sign in to comment.