Neue Google IMG Plugins

This commit is contained in:
2015-12-06 17:19:49 +01:00
parent a55d2ea60a
commit 2f93d7968c
3 changed files with 273 additions and 97 deletions

View File

@ -649,6 +649,14 @@ function cache_data(plugin, query, data, timeout, typ)
print('Caching "'..query..'" from plugin '..plugin..' (expires in '..timeout..' seconds)')
if typ == 'key' then
redis:set(hash, data)
elseif typ == 'set' then
-- make sure that you convert your data into a table:
-- {"foo", "bar", "baz"} instead of
-- {"bar" = "foo", "foo" = "bar", "bar" = "baz"}
-- because other formats are not supported by redis (or I haven't found a way to store them)
for _,str in pairs(data) do
redis:sadd(hash, str)
end
else
redis:hmset(hash, data)
end