mirror of
https://github.com/lzh-1625/go_process_manager.git
synced 2025-10-05 16:06:51 +08:00
optimal http wait
This commit is contained in:
@@ -136,7 +136,6 @@ func (p *ProcessBase) pInit() {
|
||||
go p.watchDog()
|
||||
go p.readInit()
|
||||
go p.monitorHanler()
|
||||
middle.ProcessWaitCond.Trigger()
|
||||
}
|
||||
|
||||
// fn 函数执行成功的情况下对state赋值
|
||||
|
@@ -47,8 +47,8 @@ func (p *waitCond) Trigger() {
|
||||
|
||||
func (p *waitCond) WaitGetMiddel(c *gin.Context) {
|
||||
reqUser := c.GetHeader("token")
|
||||
if ts, ok := p.timeMap.Load(reqUser); !ok || ts.(int64) < p.ts {
|
||||
p.timeMap.Store(reqUser, p.ts)
|
||||
defer p.timeMap.Store(reqUser, p.ts)
|
||||
if ts, ok := p.timeMap.Load(reqUser); !ok || ts.(int64) > p.ts {
|
||||
c.Next()
|
||||
return
|
||||
}
|
||||
|
@@ -9,7 +9,7 @@ func Unwarp[T any](result T, err error) T {
|
||||
return result
|
||||
}
|
||||
|
||||
func UnwarpIgnore[T any](result T, _ error) T {
|
||||
func UnwarpIgnore[T any](result T, _ any) T {
|
||||
return result
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user