Couple of bugs squashed.

1) It's incr not inc on the redis client, so renamed the calls everywhere
2) Redis returns bytes/string rather than an int if the value stored is an int. Cast the result to an int before use. Not you can set up the GET to do this transparently but I've not done this as we *may * use GETS for non-int and  the callback sets up the cast for the connection not the call.
This commit is contained in:
Martyn Inglis
2016-11-12 15:37:57 +00:00
parent 4c0c30bb2e
commit ac6609e653
7 changed files with 17 additions and 17 deletions

View File

@@ -151,7 +151,7 @@ def send_sms(self,
e
)
else:
redis_store.inc(cache_key(service_id))
redis_store.incr(cache_key(service_id))
@notify_celery.task(bind=True, name="send-email", max_retries=5, default_retry_delay=300)
@@ -192,4 +192,4 @@ def send_email(self, service_id,
e
)
else:
redis_store.inc(cache_key(service_id))
redis_store.incr(cache_key(service_id))