|
|
@@ -2,6 +2,7 @@ package svc |
|
|
|
|
|
|
|
import ( |
|
|
|
"applet/app/utils" |
|
|
|
"applet/app/utils/cache" |
|
|
|
"code.fnuoos.com/EggPlanet/egg_models.git/src/implement" |
|
|
|
"code.fnuoos.com/EggPlanet/egg_system_rules.git/utils/es" |
|
|
|
es2 "code.fnuoos.com/go_rely_warehouse/zyos_go_es.git/es" |
|
|
@@ -11,6 +12,7 @@ import ( |
|
|
|
) |
|
|
|
|
|
|
|
const deleteLimit = 1000 |
|
|
|
const EggEnergyAutoUpdateUserAccessLockKey = "egg_energy_auto_update_user_access_lock_key" |
|
|
|
|
|
|
|
// EggEnergyAutoUpdateUserAccess 自动更新用户访问次数记录 |
|
|
|
func EggEnergyAutoUpdateUserAccess(engine *xorm.Engine) { |
|
|
@@ -28,6 +30,13 @@ func EggEnergyAutoUpdateUserAccess(engine *xorm.Engine) { |
|
|
|
//TODO::只在凌晨两点 ~ 凌晨六点运行 |
|
|
|
return |
|
|
|
} |
|
|
|
getString, _ := cache.GetString(EggEnergyAutoUpdateUserAccessLockKey) |
|
|
|
if getString != "" { |
|
|
|
fmt.Println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", "上一次蛋蛋分统计未执行完") |
|
|
|
return |
|
|
|
} |
|
|
|
cache.SetEx(EggEnergyAutoUpdateUserAccessLockKey, "running", 4*60*60) // 4 h |
|
|
|
defer cache.Del(EggEnergyAutoUpdateUserAccessLockKey) |
|
|
|
|
|
|
|
// 获取当周信息 |
|
|
|
year, week := time.Now().ISOWeek() |
|
|
|