Skip to content

Commit

Permalink
增加主动使用redis的配置
Browse files Browse the repository at this point in the history
  • Loading branch information
piexlmax committed Feb 21, 2022
1 parent 9c41ed8 commit e2d9cfc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions server/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ system:
addr: 8888
db-type: 'mysql'
oss-type: 'local' # 控制oss选择走本地还是 七牛等其他仓 自行增加其他oss仓可以在 server/utils/upload/upload.go 中 NewOss函数配置
use-redis: false # 使用redis
use-multipoint: false
# IP限制次数 一个小时15000次
iplimit-count: 15000
Expand Down
1 change: 1 addition & 0 deletions server/config/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ type System struct {
DbType string `mapstructure:"db-type" json:"dbType" yaml:"db-type"` // 数据库类型:mysql(默认)|sqlite|sqlserver|postgresql
OssType string `mapstructure:"oss-type" json:"ossType" yaml:"oss-type"` // Oss类型
UseMultipoint bool `mapstructure:"use-multipoint" json:"useMultipoint" yaml:"use-multipoint"` // 多点登录拦截
UseRedis bool `mapstructure:"use-redis" json:"useRedis" yaml:"use-redis"` // 使用redis
LimitCountIP int `mapstructure:"iplimit-count" json:"iplimitCount" yaml:"iplimit-count"`
LimitTimeIP int `mapstructure:"iplimit-time" json:"iplimitTime" yaml:"iplimit-time"`
}
2 changes: 1 addition & 1 deletion server/core/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type server interface {
}

func RunWindowsServer() {
if global.GVA_CONFIG.System.UseMultipoint {
if global.GVA_CONFIG.System.UseMultipoint || global.GVA_CONFIG.System.UseRedis {
// 初始化redis服务
initialize.Redis()
}
Expand Down

0 comments on commit e2d9cfc

Please sign in to comment.