Neue Google IMG Plugins
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user