1234567891011121314151617181920212223242526272829303132333435 |
- --[[
- Descripttion:战斗记录
- version:
- Author: Neo,Huang
- Date: 2023-11-18 13:56:05
- LastEditors: Neo,Huang
- LastEditTime: 2023-11-18 13:57:08
- --]]
- local timer = require("timer")
- local baseService = require("baseService")
- local lib_game_mysql = require("lib_game_mysql")
- local timerDelExpire = nil
- local CMD = {}
- -- 清理过期追梦记录
- local function l_del_expire_record()
- local currTime = skynet_time()
- local sql = string.format("delete from mdl_battlerecord where expireTime >0 and expireTime < %s;", tostring(currTime))
- local ret = lib_game_mysql:query(sql)
- log.info("l_del_expire_record sql[%s] ret[%s]", tostring(sql), tostring(ret))
- end
- function CMD.onStart()
- timerDelExpire = timer.timeOut(60, l_del_expire_record)
- end
- function CMD.onStop()
- -- 取消定时器
- timerDelExpire.func = nil
- end
- baseService.start(CMD, ".battlerecordCenter", true)
|