[add] heavy query caching, [add] wpm leaderboard

This commit is contained in:
2023-10-03 16:47:38 -04:00
parent 5cd4e165b0
commit 4e1ee0022a
20 changed files with 1144 additions and 969 deletions

View File

@@ -72,7 +72,8 @@ end
-------------- New Functions -------------
------------------------------------------
function SyncNinjaClient:check_activity(username, password, device_id, callback)
function SyncNinjaClient:check_activity(username, password, device_id, device,
callback)
self.client:reset_middlewares()
self.client:enable("Format.JSON")
self.client:enable("GinClient")
@@ -82,7 +83,10 @@ function SyncNinjaClient:check_activity(username, password, device_id, callback)
socketutil:set_timeout(SYNC_TIMEOUTS[1], SYNC_TIMEOUTS[2])
local co = coroutine.create(function()
local ok, res = pcall(function()
return self.client:check_activity({device_id = device_id})
return self.client:check_activity({
device_id = device_id,
device = device
})
end)
if ok then
callback(res.status == 200, res.body)