修复 curve 接口的一些问题
This commit is contained in:
+8
-4
@@ -69,10 +69,14 @@ func main() {
|
||||
// 启动时预热缓存
|
||||
warmUpCache(log, db, rdb)
|
||||
|
||||
// 启动定时刷入任务:每 5 分钟从 Redis 刷入数据库
|
||||
deviceRepo := repository.NewDeviceRepository(db)
|
||||
devicePersistTask := task.NewDevicePersistTask(rdb, deviceRepo, log)
|
||||
devicePersistTask.Start(5 * time.Minute)
|
||||
// 启动定时刷入任务:每 5 分钟从 Redis 刷入数据库(仅 ENABLE_PERSIST_TASK=true 的容器运行)
|
||||
if cfg.EnablePersistTask {
|
||||
deviceRepo := repository.NewDeviceRepository(db)
|
||||
devicePersistTask := task.NewDevicePersistTask(rdb, deviceRepo, log)
|
||||
devicePersistTask.Start(5 * time.Minute)
|
||||
} else {
|
||||
log.Info("device persist task disabled")
|
||||
}
|
||||
|
||||
engine := router.New(log, db, searchClient, rdb, cfg.Equalize)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user