Skip to content

Commit

Permalink
fix: injected app-serveice dependency into DeployedApplicationEventPr…
Browse files Browse the repository at this point in the history
…ocessor service (#4875)
  • Loading branch information
gireesh-naidu authored Apr 3, 2024
1 parent 6b74445 commit 0b45f25
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ type DeployedApplicationEventProcessorImpl struct {
installedAppRepository repository.InstalledAppRepository
}

func NewDeployedApplicationEventProcessorImpl(logger *zap.SugaredLogger, pubSubClient *pubsub.PubSubClientServiceImpl,
func NewDeployedApplicationEventProcessorImpl(logger *zap.SugaredLogger,
pubSubClient *pubsub.PubSubClientServiceImpl,
appService app.AppService,
gitOpsConfigReadService config.GitOpsConfigReadService,
installedAppService FullMode.InstalledAppDBExtendedService,
workflowDagExecutor dag.WorkflowDagExecutor,
Expand All @@ -54,6 +56,7 @@ func NewDeployedApplicationEventProcessorImpl(logger *zap.SugaredLogger, pubSubC
deployedApplicationEventProcessorImpl := &DeployedApplicationEventProcessorImpl{
logger: logger,
pubSubClient: pubSubClient,
appService: appService,
gitOpsConfigReadService: gitOpsConfigReadService,
installedAppService: installedAppService,
workflowDagExecutor: workflowDagExecutor,
Expand Down Expand Up @@ -86,10 +89,10 @@ func (impl *DeployedApplicationEventProcessorImpl) SubscribeArgoAppUpdate() erro
_, err = impl.pipelineRepository.GetArgoPipelineByArgoAppName(app.ObjectMeta.Name)
if err != nil && err == pg.ErrNoRows {
impl.logger.Infow("this app not found in pipeline table looking in installed_apps table", "appName", app.ObjectMeta.Name)
//if not found in pipeline table then search in installed_apps table
// if not found in pipeline table then search in installed_apps table
installedAppModel, err := impl.installedAppRepository.GetInstalledAppByGitOpsAppName(app.ObjectMeta.Name)
if err == pg.ErrNoRows {
//no installed_apps found
// no installed_apps found
impl.logger.Errorw("no installed apps found", "err", err)
return
}
Expand All @@ -98,7 +101,7 @@ func (impl *DeployedApplicationEventProcessorImpl) SubscribeArgoAppUpdate() erro
return
}
if installedAppModel.Id > 0 {
//app found in installed_apps table hence setting flag to true
// app found in installed_apps table hence setting flag to true
isAppStoreApplication = true
} else {
// app neither found in installed_apps nor in pipeline table hence returning
Expand Down
2 changes: 1 addition & 1 deletion wire_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0b45f25

Please sign in to comment.