diff options
| author | ruki <[email protected]> | 2022-05-21 10:19:55 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-05-21 10:19:55 +0800 |
| commit | 946bbbfde23973d2858fc21e34bcb38c47c59b54 (patch) | |
| tree | b0958f576b077c88fd4db10d286a6558cf2e2350 | |
| parent | 525f5145e9b0a1a28757bf8273b74d4caf675f57 (diff) | |
fix get cacheinfo
| -rw-r--r-- | xmake/modules/private/service/remote_cache/client.lua | 2 | ||||
| -rw-r--r-- | xmake/modules/private/service/remote_cache/server_session.lua | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/xmake/modules/private/service/remote_cache/client.lua b/xmake/modules/private/service/remote_cache/client.lua index b2ff17873..33f6ee886 100644 --- a/xmake/modules/private/service/remote_cache/client.lua +++ b/xmake/modules/private/service/remote_cache/client.lua @@ -244,7 +244,7 @@ function remote_cache_client:cacheinfo(cachekey) local cacheinfo dprint("%s: get cacheinfo(%s) in %s:%d ..", self, cachekey, addr, port) local stream = socket_stream(sock) - if stream:send_msg(message.new_clean(session_id, {token = self:token()})) and stream:flush() then + if stream:send_msg(message.new_fileinfo(session_id, cachekey, {token = self:token()})) and stream:flush() then local msg = stream:recv_msg() if msg then dprint(msg:body()) diff --git a/xmake/modules/private/service/remote_cache/server_session.lua b/xmake/modules/private/service/remote_cache/server_session.lua index a73734749..ee4b5b1f2 100644 --- a/xmake/modules/private/service/remote_cache/server_session.lua +++ b/xmake/modules/private/service/remote_cache/server_session.lua @@ -80,6 +80,7 @@ function server_session:pull(respmsg) local stream = self:stream() local cachekey = body.filename local cachefile = path.join(self:cachedir(), cachekey:sub(1, 2), cachekey) + vprint("pull cachefile(%s) ..", cachekey) -- send cache file if os.isfile(cachefile) then @@ -102,6 +103,7 @@ function server_session:push(respmsg) local cachekey = body.filename local cachefile = path.join(self:cachedir(), cachekey:sub(1, 2), cachekey) local cachefile_tmp = cachefile .. ".tmp" + vprint("push cachefile(%s) ..", cachekey) if not stream:recv_file(cachefile_tmp) then os.tryrm(cachefile_tmp) raise("recv %s failed!", cachefile) @@ -116,6 +118,7 @@ function server_session:fileinfo(respmsg) local cachekey = body.filename local cachefile = path.join(self:cachedir(), cachekey:sub(1, 2), cachekey) body.fileinfo = {filesize = os.filesize(cachefile), exists = os.isfile(cachefile)} + vprint("get cacheinfo(%s)", cachekey) end -- clean files |
