mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-25 04:33:05 +00:00
并发请求 sharedata.query 返回增加缓存状态检查 (#1266)
This commit is contained in:
@@ -30,6 +30,10 @@ function sharedata.query(name)
|
||||
return cache[name]
|
||||
end
|
||||
local obj = skynet.call(service, "lua", "query", name)
|
||||
if cache[name] and cache[name].__obj == obj then
|
||||
skynet.send(service, "lua", "confirm" , obj)
|
||||
return cache[name]
|
||||
end
|
||||
local r = sd.box(obj)
|
||||
skynet.send(service, "lua", "confirm" , obj)
|
||||
skynet.fork(monitor,name, r, obj)
|
||||
|
||||
Reference in New Issue
Block a user