Fixed - TasksService.addAsync() and RedissonExecutorService.pushTaskAsync(), 'publish' won't take effect #6365

Signed-off-by: xuxiaolei <seakider@gmail.com>
pull/6367/head
seakider 1 month ago committed by xuxiaolei
parent 694a51af30
commit 35e2865213

@ -260,7 +260,7 @@ public class RedissonExecutorService implements RScheduledExecutorService {
+ "local v = redis.call('zrange', KEYS[2], 0, 0); " + "local v = redis.call('zrange', KEYS[2], 0, 0); "
// if new task added to queue head then publish its startTime // if new task added to queue head then publish its startTime
// to all scheduler workers // to all scheduler workers
+ "if v[1] == expiredTaskIds[i] then " + "if v[1] == scheduledName then "
+ "redis.call('publish', KEYS[3], startTime); " + "redis.call('publish', KEYS[3], startTime); "
+ "end;" + "end;"

@ -132,12 +132,13 @@ public class TasksService extends BaseRemoteService {
+ "end; " + "end; "
+ "if tonumber(ARGV[1]) > 0 then " + "if tonumber(ARGV[1]) > 0 then "
+ "local scheduledName = 'ff:' .. ARGV[2];"
+ "redis.call('set', KEYS[7], ARGV[4]);" + "redis.call('set', KEYS[7], ARGV[4]);"
+ "redis.call('zadd', KEYS[3], ARGV[1], 'ff:' .. ARGV[2]);" + "redis.call('zadd', KEYS[3], ARGV[1], scheduledName);"
+ "local v = redis.call('zrange', KEYS[3], 0, 0); " + "local v = redis.call('zrange', KEYS[3], 0, 0); "
// if new task added to queue head then publish its startTime // if new task added to queue head then publish its startTime
// to all scheduler workers // to all scheduler workers
+ "if v[1] == ARGV[2] then " + "if v[1] == scheduledName then "
+ "redis.call('publish', KEYS[4], ARGV[1]); " + "redis.call('publish', KEYS[4], ARGV[1]); "
+ "end; " + "end; "
+ "end;" + "end;"

Loading…
Cancel
Save