durable_rules 0.34.56 → 0.34.57

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1839ca20ebfc39836490893e76d37423ce6bde97
4
- data.tar.gz: 6c701a34e592b43a49fad96c2aa5d9e1c245fc2e
3
+ metadata.gz: 498fdfaaecffebdf986536f05cdf517d8e1388f1
4
+ data.tar.gz: 2eaf9c77fa2b171c8263d9eb408aaf434b211d10
5
5
  SHA512:
6
- metadata.gz: 0d8038add6e89b2f41e93ea44f2f36788c42efc1d03bc6a73aeb30088b3b66f152b4a9da60b7dfee79f2a911af01033b8d75b31151bf8f8ae7ec7a6a0a9239a0
7
- data.tar.gz: 31283e8ff9e14560170b600d098963eaa60862c8382d4429c8c5862d7d2de21d52c8ae282ccc5d0d377fe1150ef668811ed1c3709cb406ed59ed95024b021f9d
6
+ metadata.gz: 1677ae9c1459c7dd6310aa7c26502af432ddc2e69b5a8254541d7c633f7694a2f7df1459d53813ba4049a3e0a59f49a68da9515f4a5e85f5dd2d976b542175c2
7
+ data.tar.gz: 32eef26b4e7d94155664a9d85d2e217cd446fb9abb52a7b43940783b90a16ba367575cef1be028f71f024ffcc353f05202450797b91a10e48e52a09c764d0763
data/src/rules/events.c CHANGED
@@ -2081,7 +2081,7 @@ unsigned int cancelTimer(unsigned int handle, char *sid, char *timerName) {
2081
2081
  return result;
2082
2082
  }
2083
2083
 
2084
- return removeTimer(rulesBinding, timerName);
2084
+ return removeTimer(rulesBinding, sid, timerName);
2085
2085
  }
2086
2086
 
2087
2087
  unsigned int renewActionLease(unsigned int handle, char *sid) {
data/src/rules/net.c CHANGED
@@ -533,11 +533,14 @@ static unsigned int loadRemoveTimerCommand(ruleset *tree, binding *rulesBinding)
533
533
  char *lua = NULL;
534
534
  if (asprintf(&lua,
535
535
  "local timer_key = \"%s!t\"\n"
536
- "local timer_name = ARGV[1]\n"
536
+ "local sid = ARGV[1]\n"
537
+ "local timer_name = ARGV[2]\n"
537
538
  "local res = redis.call(\"zrange\", timer_key, 0, -1)\n"
538
539
  "for i = 1, #res, 1 do\n"
539
540
  " if string.find(res[i], \"\\\"%%$t\\\"%%s*:%%s*\\\"\" .. timer_name .. \"\\\"\") then\n"
540
- " redis.call(\"zrem\", timer_key, res[i])\n"
541
+ " if string.find(res[i], \"\\\"sid\\\"%%s*:%%s*\\\"\" .. sid .. \"\\\"\") then\n"
542
+ " redis.call(\"zrem\", timer_key, res[i])\n"
543
+ " end\n"
541
544
  " end\n"
542
545
  "end\n"
543
546
  "return 0\n", name) == -1) {
@@ -3124,12 +3127,13 @@ unsigned int registerTimer(void *rulesBinding, unsigned int duration, char asser
3124
3127
  return RULES_OK;
3125
3128
  }
3126
3129
 
3127
- unsigned int removeTimer(void *rulesBinding, char *timerName) {
3130
+ unsigned int removeTimer(void *rulesBinding, char *sid, char *timerName) {
3128
3131
  binding *currentBinding = (binding*)rulesBinding;
3129
3132
  redisContext *reContext = currentBinding->reContext;
3130
3133
  int result = redisAppendCommand(reContext,
3131
- "evalsha %s 0 %s",
3134
+ "evalsha %s 0 %s %s",
3132
3135
  currentBinding->removeTimerHash,
3136
+ sid,
3133
3137
  timerName);
3134
3138
  VERIFY(result, "removeTimer");
3135
3139
  return RULES_OK;
data/src/rules/net.h CHANGED
@@ -137,6 +137,7 @@ unsigned int registerTimer(void *rulesBinding,
137
137
  char *timer);
138
138
 
139
139
  unsigned int removeTimer(void *rulesBinding,
140
+ char *sid,
140
141
  char *timerName);
141
142
 
142
143
  unsigned int registerMessage(void *rulesBinding,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: durable_rules
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.34.56
4
+ version: 0.34.57
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jesus Ruiz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-22 00:00:00.000000000 Z
11
+ date: 2019-03-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake