Remove unused lua script to delete by sender and timestamp
This commit is contained in:
parent
a46045d987
commit
3e8d79e147
|
@ -54,7 +54,6 @@ public class MessagesCache extends RedisClusterPubSubAdapter<String, String> imp
|
|||
private final ExecutorService notificationExecutorService;
|
||||
|
||||
private final ClusterLuaScript insertScript;
|
||||
private final ClusterLuaScript removeBySenderScript;
|
||||
private final ClusterLuaScript removeByGuidScript;
|
||||
private final ClusterLuaScript getItemsScript;
|
||||
private final ClusterLuaScript removeQueueScript;
|
||||
|
@ -99,7 +98,6 @@ public class MessagesCache extends RedisClusterPubSubAdapter<String, String> imp
|
|||
this.notificationExecutorService = notificationExecutorService;
|
||||
|
||||
this.insertScript = ClusterLuaScript.fromResource(insertCluster, "lua/insert_item.lua", ScriptOutputType.INTEGER);
|
||||
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);
|
||||
this.removeQueueScript = ClusterLuaScript.fromResource(readDeleteCluster, "lua/remove_queue.lua", ScriptOutputType.STATUS);
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
local queueKey = KEYS[1]
|
||||
local queueMetadataKey = KEYS[2]
|
||||
local queueTotalIndexKey = KEYS[3]
|
||||
local sender = ARGV[1]
|
||||
|
||||
local messageId = redis.call("HGET", queueMetadataKey, sender)
|
||||
|
||||
if messageId then
|
||||
local envelope = redis.call("ZRANGEBYSCORE", queueKey, messageId, messageId, "LIMIT", 0, 1)
|
||||
local guid = redis.call("HGET", queueMetadataKey, messageId .. "guid")
|
||||
|
||||
redis.call("ZREMRANGEBYSCORE", queueKey, messageId, messageId)
|
||||
redis.call("HDEL", queueMetadataKey, sender)
|
||||
redis.call("HDEL", queueMetadataKey, messageId)
|
||||
|
||||
if guid then
|
||||
redis.call("HDEL", queueMetadataKey, guid)
|
||||
redis.call("HDEL", queueMetadataKey, messageId .. "guid")
|
||||
end
|
||||
|
||||
if (redis.call("ZCARD", queueKey) == 0) then
|
||||
redis.call("ZREM", queueTotalIndexKey, queueKey)
|
||||
end
|
||||
|
||||
if envelope and next(envelope) then
|
||||
return envelope[1]
|
||||
end
|
||||
end
|
||||
|
||||
return nil
|
Loading…
Reference in New Issue