Skip to content

Commit cd47d30

Browse files
gireesh-naidukomalreddy3
authored andcommitted
fix: injected app-serveice dependency into DeployedApplicationEventProcessor service (#4875)
1 parent daa56ca commit cd47d30

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

pkg/eventProcessor/in/DeployedApplicationEventProcessorService.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ type DeployedApplicationEventProcessorImpl struct {
4242
installedAppRepository repository.InstalledAppRepository
4343
}
4444

45-
func NewDeployedApplicationEventProcessorImpl(logger *zap.SugaredLogger, pubSubClient *pubsub.PubSubClientServiceImpl,
45+
func NewDeployedApplicationEventProcessorImpl(logger *zap.SugaredLogger,
46+
pubSubClient *pubsub.PubSubClientServiceImpl,
47+
appService app.AppService,
4648
gitOpsConfigReadService config.GitOpsConfigReadService,
4749
installedAppService FullMode.InstalledAppDBExtendedService,
4850
workflowDagExecutor dag.WorkflowDagExecutor,
@@ -54,6 +56,7 @@ func NewDeployedApplicationEventProcessorImpl(logger *zap.SugaredLogger, pubSubC
5456
deployedApplicationEventProcessorImpl := &DeployedApplicationEventProcessorImpl{
5557
logger: logger,
5658
pubSubClient: pubSubClient,
59+
appService: appService,
5760
gitOpsConfigReadService: gitOpsConfigReadService,
5861
installedAppService: installedAppService,
5962
workflowDagExecutor: workflowDagExecutor,
@@ -86,10 +89,10 @@ func (impl *DeployedApplicationEventProcessorImpl) SubscribeArgoAppUpdate() erro
8689
_, err = impl.pipelineRepository.GetArgoPipelineByArgoAppName(app.ObjectMeta.Name)
8790
if err != nil && err == pg.ErrNoRows {
8891
impl.logger.Infow("this app not found in pipeline table looking in installed_apps table", "appName", app.ObjectMeta.Name)
89-
//if not found in pipeline table then search in installed_apps table
92+
// if not found in pipeline table then search in installed_apps table
9093
installedAppModel, err := impl.installedAppRepository.GetInstalledAppByGitOpsAppName(app.ObjectMeta.Name)
9194
if err == pg.ErrNoRows {
92-
//no installed_apps found
95+
// no installed_apps found
9396
impl.logger.Errorw("no installed apps found", "err", err)
9497
return
9598
}
@@ -98,7 +101,7 @@ func (impl *DeployedApplicationEventProcessorImpl) SubscribeArgoAppUpdate() erro
98101
return
99102
}
100103
if installedAppModel.Id > 0 {
101-
//app found in installed_apps table hence setting flag to true
104+
// app found in installed_apps table hence setting flag to true
102105
isAppStoreApplication = true
103106
} else {
104107
// app neither found in installed_apps nor in pipeline table hence returning

wire_gen.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)