Skip to content

Commit

Permalink
fix(config): 修正自动退群阈值与前端通信的单位 (#507)
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiangze-Li authored and JustAnotherID committed Jan 20, 2024
1 parent c5a5a3e commit 5e79d28
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions api/dice_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ func DiceConfig(c echo.Context) error {
info.ExtDefaultSettings = extDefaultSettings
info.DefaultCocRuleIndex = cocRule
info.MailPassword = emailPasswordMasked
info.Config.QuitInactiveThresholdDays = info.QuitInactiveThreshold.Hours() / 24

return c.JSON(http.StatusOK, info)
}
Expand Down
4 changes: 3 additions & 1 deletion dice/dice_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,10 @@ type RateLimitConfig struct {
}

type QuitInactiveConfig struct {
QuitInactiveThreshold time.Duration `yaml:"quitInactiveThreshold" json:"quitInactiveThreshold"` // 退出不活跃群组的时间阈值
QuitInactiveThreshold time.Duration `yaml:"quitInactiveThreshold" json:"-"` // 退出不活跃群组的时间阈值
quitInactiveCronEntry cron.EntryID

QuitInactiveThresholdDays float64 `yaml:"-" json:"quitInactiveThreshold"` // 为了和前端通信
}

type ExtConfig struct {
Expand Down

0 comments on commit 5e79d28

Please sign in to comment.