This commit is contained in:
aozhiwei 2024-04-09 15:05:37 +08:00
parent e5917e6c3e
commit cb070446ad

View File

@ -11,6 +11,7 @@ type taskLock struct {
type AsyncTask struct {
status int32
debugInfo string
cb func(*AsyncTask)
succCb func(*AsyncTask)
failCb func(*AsyncTask)
@ -169,5 +170,18 @@ func NewLockAsyncTask(keys [][]string, cb func(*LockAsyncTask)) *LockAsyncTask {
p.lockKeys[lock.key] = lock
_app.forcePendingAsyncTask(lock.key).AddTail(&lock.entry)
}
if q5.IsDebug() {
p.debugInfo = q5.GetCallStack()
_timer.SetTimeout(
2,
func (e int32, args* q5.Args) {
if e == q5.TIMER_EXEC_EVENT {
if p.IsRunning() {
_sysLog.Warning("LockAsyncaskTimeOut ", p.debugInfo)
panic("LockAsyncaskTimeOut")
}
}
})
}
return p.init(cb).checkDo()
}