Remove unused lua script

This commit is contained in:
Ehren Kret 2021-08-09 16:57:25 -05:00
parent f58a320223
commit 52d13d1d62
2 changed files with 0 additions and 31 deletions

View File

@ -54,7 +54,6 @@ public class MessagesCache extends RedisClusterPubSubAdapter<String, String> imp
private final ExecutorService notificationExecutorService;
private final ClusterLuaScript insertScript;
private final ClusterLuaScript removeByIdScript;
private final ClusterLuaScript removeBySenderScript;
private final ClusterLuaScript removeByGuidScript;
private final ClusterLuaScript getItemsScript;
@ -101,7 +100,6 @@ public class MessagesCache extends RedisClusterPubSubAdapter<String, String> imp
this.notificationExecutorService = notificationExecutorService;
this.insertScript = ClusterLuaScript.fromResource(insertCluster, "lua/insert_item.lua", ScriptOutputType.INTEGER);
this.removeByIdScript = ClusterLuaScript.fromResource(readDeleteCluster, "lua/remove_item_by_id.lua", ScriptOutputType.VALUE);
this.removeBySenderScript = ClusterLuaScript.fromResource(readDeleteCluster, "lua/remove_item_by_sender.lua", ScriptOutputType.VALUE);
this.removeByGuidScript = ClusterLuaScript.fromResource(readDeleteCluster, "lua/remove_item_by_guid.lua", ScriptOutputType.MULTI);
this.getItemsScript = ClusterLuaScript.fromResource(readDeleteCluster, "lua/get_items.lua", ScriptOutputType.MULTI);

View File

@ -1,29 +0,0 @@
local queueKey = KEYS[1]
local queueMetadataKey = KEYS[2]
local queueTotalIndexKey = KEYS[3]
local id = ARGV[1]
local envelope = redis.call("ZRANGEBYSCORE", queueKey, id, id, "LIMIT", 0, 1)
local removedCount = redis.call("ZREMRANGEBYSCORE", queueKey, id, id)
local senderIndex = redis.call("HGET", queueMetadataKey, id)
local guidIndex = redis.call("HGET", queueMetadataKey, id .. "guid")
if senderIndex then
redis.call("HDEL", queueMetadataKey, senderIndex)
redis.call("HDEL", queueMetadataKey, id)
end
if guidIndex then
redis.call("HDEL", queueMetadataKey, guidIndex)
redis.call("HDEL", queueMetadataKey, id .. "guid")
end
if (redis.call("ZCARD", queueKey) == 0) then
redis.call("ZREM", queueTotalIndexKey, queueKey)
end
if envelope and next(envelope) then
return envelope[1]
else
return nil
end