[MM-40817] Add license wrapper (#19648)
* add license service interface * add wrapper * remove wrapper from channels struct until its being used * add comments
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
229200720c
Коммит
f2471200f9
@@ -89,7 +89,8 @@ var SentryDSN = "placeholder_sentry_dsn"
|
||||
type ServiceKey string
|
||||
|
||||
const (
|
||||
ConfigKey ServiceKey = "config"
|
||||
ConfigKey ServiceKey = "config"
|
||||
LicenseKey ServiceKey = "license"
|
||||
)
|
||||
|
||||
type Server struct {
|
||||
@@ -141,6 +142,7 @@ type Server struct {
|
||||
licenseValue atomic.Value
|
||||
clientLicenseValue atomic.Value
|
||||
licenseListeners map[string]func(*model.License, *model.License)
|
||||
licenseWrapper *licenseWrapper
|
||||
|
||||
timezones *timezones.Timezones
|
||||
|
||||
@@ -255,10 +257,15 @@ func NewServer(options ...Option) (*Server, error) {
|
||||
mlog.Info("Server is initializing...", mlog.String("go_version", runtime.Version()))
|
||||
|
||||
s.httpService = httpservice.MakeHTTPService(s)
|
||||
s.licenseWrapper = &licenseWrapper{
|
||||
srv: s,
|
||||
}
|
||||
|
||||
serviceMap := map[ServiceKey]interface{}{
|
||||
ConfigKey: s.configStore,
|
||||
ConfigKey: s.configStore,
|
||||
LicenseKey: s.licenseWrapper,
|
||||
}
|
||||
|
||||
// Step 3: Initialize products.
|
||||
// Depends on s.httpService.
|
||||
for name, initializer := range products {
|
||||
|
||||
Ссылка в новой задаче
Block a user