Skip to content

Commit

Permalink
fix: 解决使用docker运行获取秘钥异常的问题 (#263)
Browse files Browse the repository at this point in the history
  • Loading branch information
eryajf committed Jun 22, 2023
1 parent fb4c3ee commit 5d208ab
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type Configuration struct {
// 会话超时时间
SessionTimeout time.Duration `yaml:"session_timeout"`
// 最大问题长度
MaxQuestionLen int `yaml:"max_question_len"`
MaxQuestionLen int `yaml:"max_question_len"`
// 最大答案长度
MaxAnswerLen int `yaml:"max_answer_len"`
// 最大文本 = 问题 + 回答, 接口限制
Expand Down Expand Up @@ -224,11 +224,10 @@ func LoadConfig() *Configuration {
if azureOpenaiToken != "" {
config.AzureOpenAIToken = azureOpenaiToken
}

credentials := os.Getenv("DINGTALK_CREDENTIALS")
if credentials != "" {
if config.Credentials == nil {
config.Credentials = []Credential{}
}
config.Credentials = []Credential{}
for _, idSecret := range strings.Split(credentials, ",") {
items := strings.SplitN(idSecret, ":", 2)
if len(items) == 2 {
Expand Down

0 comments on commit 5d208ab

Please sign in to comment.