MSP-5093 remove global varibale
This commit is contained in:
1 parent
055921d711
commit
46fc51275e
8 files changed
+23
-19
No files matched your search
@@ -2,6 +2,7 @@ package assembly
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"github.com/txix-open/isp-kit/app"
|
||||
@@ -70,7 +71,7 @@ func (a *Assembly) ReceiveConfig(ctx context.Context, remoteConfig []byte) error
|
||||
return nil, errors.WithMessage(err, "new repository")
|
||||
}
|
||||
return repo, nil
|
||||
}, newCfg)
|
||||
}, newCfg, time.Minute)
|
||||
|
||||
a.server.Upgrade(config.Handler)
|
||||
|
||||
|
||||
+8
-7
@@ -22,10 +22,6 @@ import (
|
||||
"msp-admin-service/transaction"
|
||||
)
|
||||
|
||||
var (
|
||||
JobPollInterval = 1 * time.Minute //nolint:gochecknoglobals
|
||||
)
|
||||
|
||||
type DB interface {
|
||||
db.DB
|
||||
db.Transactional
|
||||
@@ -51,7 +47,12 @@ type Config struct {
|
||||
}
|
||||
|
||||
//nolint:funlen
|
||||
func (l Locator) Config(ctx context.Context, ldapRepoSupplier ldap.RepoSupplier, cfg conf.Remote) Config {
|
||||
func (l Locator) Config(
|
||||
ctx context.Context,
|
||||
ldapRepoSupplier ldap.RepoSupplier,
|
||||
cfg conf.Remote,
|
||||
jobPollInterval time.Duration,
|
||||
) Config {
|
||||
sudirRepo := repository.NewSudir(l.httpCli, cfg.SudirAuth)
|
||||
roleRepo := repository.NewRole(l.db)
|
||||
userRepo := repository.NewUser(l.db)
|
||||
@@ -129,12 +130,12 @@ func (l Locator) Config(ctx context.Context, ldapRepoSupplier ldap.RepoSupplier,
|
||||
BgJobCfg: []bgjobx.WorkerConfig{{
|
||||
Queue: delete_old_audit_worker.QueueName,
|
||||
Concurrency: 1,
|
||||
PollInterval: JobPollInterval,
|
||||
PollInterval: jobPollInterval,
|
||||
Handle: deleteOldAuditWorker,
|
||||
}, {
|
||||
Queue: inactive_worker.QueueName,
|
||||
Concurrency: 1,
|
||||
PollInterval: JobPollInterval,
|
||||
PollInterval: jobPollInterval,
|
||||
Handle: inactiveBlocker,
|
||||
}},
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user