mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-11-05 21:02:11 +08:00
Adjust configuration settings
This commit is contained in:
parent
f32fcdaf1a
commit
7dff742444
@ -62,7 +62,7 @@ func GetProjectRoot() (string, error) {
|
|||||||
return projectRoot, nil
|
return projectRoot, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetOptionsByNotification(cfg NotificationConf) msgprocessor.Options {
|
func GetOptionsByNotification(cfg NotificationConfig) msgprocessor.Options {
|
||||||
opts := msgprocessor.NewOptions()
|
opts := msgprocessor.NewOptions()
|
||||||
|
|
||||||
if cfg.UnreadCount {
|
if cfg.UnreadCount {
|
||||||
@ -107,23 +107,3 @@ func initConfig(config any, configName, configFolderPath string) error {
|
|||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func InitConfig(config *GlobalConfig, configFolderPath string) (err error) {
|
|
||||||
if configFolderPath == "" {
|
|
||||||
envConfigPath := os.Getenv("OPENIMCONFIG")
|
|
||||||
if envConfigPath != "" {
|
|
||||||
configFolderPath = envConfigPath
|
|
||||||
} else {
|
|
||||||
configFolderPath, err = GetDefaultConfigPath()
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := initConfig(config, FileName, configFolderPath); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return initConfig(&config.Notification, NotificationFileName, configFolderPath)
|
|
||||||
}
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user