no more ttl
This commit is contained in:
parent
71b827fe95
commit
170021af8e
2 changed files with 1 additions and 7 deletions
|
|
@ -266,12 +266,7 @@ function M.get_contest_list(platform)
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
local contest_list_data = cache_data.contest_lists[platform]
|
return cache_data.contest_lists[platform].contests
|
||||||
if os.time() >= contest_list_data.expires_at then
|
|
||||||
return nil
|
|
||||||
end
|
|
||||||
|
|
||||||
return contest_list_data.contests
|
|
||||||
end
|
end
|
||||||
|
|
||||||
---@param platform string
|
---@param platform string
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,6 @@ describe('cp.cache', function()
|
||||||
|
|
||||||
local result = cache.get_contest_data('cses', 'test_contest')
|
local result = cache.get_contest_data('cses', 'test_contest')
|
||||||
assert.is_not_nil(result)
|
assert.is_not_nil(result)
|
||||||
assert.is_not_nil(result.expires_at)
|
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue