@@ -32,7 +32,6 @@ import (
32
32
"github.com/devtron-labs/devtron/api/helm-app/service/bean"
33
33
"github.com/devtron-labs/devtron/internal/sql/models"
34
34
"github.com/devtron-labs/devtron/internal/sql/repository"
35
- "github.com/devtron-labs/devtron/pkg/asyncProvider"
36
35
utils1 "github.com/devtron-labs/devtron/pkg/clusterTerminalAccess/clusterTerminalUtils"
37
36
"github.com/devtron-labs/devtron/pkg/k8s"
38
37
bean2 "github.com/devtron-labs/devtron/pkg/k8s/bean"
@@ -102,7 +101,12 @@ func GetTerminalAccessConfig() (*models.UserTerminalSessionConfig, error) {
102
101
return config , err
103
102
}
104
103
105
- func NewUserTerminalAccessServiceImpl (logger * zap.SugaredLogger , terminalAccessRepository repository.TerminalAccessRepository , config * models.UserTerminalSessionConfig , k8sCommonService k8s.K8sCommonService , terminalSessionHandler terminal.TerminalSessionHandler , K8sCapacityService capacity.K8sCapacityService , k8sUtil * k8s2.K8sServiceImpl , cronLogger * cron3.CronLoggerImpl ) (* UserTerminalAccessServiceImpl , error ) {
104
+ func NewUserTerminalAccessServiceImpl (logger * zap.SugaredLogger ,
105
+ terminalAccessRepository repository.TerminalAccessRepository ,
106
+ config * models.UserTerminalSessionConfig , k8sCommonService k8s.K8sCommonService ,
107
+ terminalSessionHandler terminal.TerminalSessionHandler ,
108
+ K8sCapacityService capacity.K8sCapacityService , k8sUtil * k8s2.K8sServiceImpl ,
109
+ cronLogger * cron3.CronLoggerImpl , asyncRunnable * async.Runnable ) (* UserTerminalAccessServiceImpl , error ) {
106
110
//fetches all running and starting entities from db and start SyncStatus
107
111
podStatusSyncCron := cron .New (cron .WithChain (cron .Recover (cronLogger )))
108
112
terminalAccessDataArrayMutex := & sync.RWMutex {}
@@ -118,7 +122,7 @@ func NewUserTerminalAccessServiceImpl(logger *zap.SugaredLogger, terminalAccessR
118
122
terminalSessionHandler : terminalSessionHandler ,
119
123
K8sCapacityService : K8sCapacityService ,
120
124
k8sUtil : k8sUtil ,
121
- asyncRunnable : asyncProvider . NewAsyncRunnable ( logger ) ,
125
+ asyncRunnable : asyncRunnable ,
122
126
}
123
127
podStatusSyncCron .Start ()
124
128
_ , err := podStatusSyncCron .AddFunc (fmt .Sprintf ("@every %ds" , config .TerminalPodStatusSyncTimeInSecs ), accessServiceImpl .SyncPodStatus )
0 commit comments