1234567891011121314151617181920212223 |
- package initialize
- import (
- "github.com/songzhibin97/gkit/cache/local_cache"
- "lc-fangdaosha/global"
- "lc-fangdaosha/utils"
- )
- func OtherInit() {
- dr, err := utils.ParseDuration(global.Config.JWT.ExpiresTime)
- if err != nil {
- panic(err)
- }
- _, err = utils.ParseDuration(global.Config.JWT.BufferTime)
- if err != nil {
- panic(err)
- }
- //创建缓存,配置过期时间
- global.BlackCache = local_cache.NewCache(
- local_cache.SetDefaultExpire(dr),
- )
- }
|