Yuvipanda has submitted this change and it was merged.

Change subject: Perform saving when adding new subscriptions atomically
......................................................................


Perform saving when adding new subscriptions atomically

Change-Id: I8e6dcfa02f319fd0ea104f1e0ceccab64540b55f
---
M src/subscriptions.py
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Yuvipanda: Verified; Looks good to me, approved



diff --git a/src/subscriptions.py b/src/subscriptions.py
index 003f0fd..3f8a951 100755
--- a/src/subscriptions.py
+++ b/src/subscriptions.py
@@ -28,8 +28,8 @@
     return PREFIX + "_" + '.'.join(key_parts)
 
 def add_subscription(args):
-    red.sadd(make_key(CLIENTS_KEY), args.key)
-    red.save() # We don't want to lose client lists do we
+    # Save these explicitly, to avoid them from getting lost
+    red.pipeline().sadd(make_key(CLIENTS_KEY), args.key).save().execute()
     logging.info('Added key %s' % args.key)
 
 def list_subscriptions(args):

-- 
To view, visit https://gerrit.wikimedia.org/r/76466
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I8e6dcfa02f319fd0ea104f1e0ceccab64540b55f
Gerrit-PatchSet: 2
Gerrit-Project: labs/tools/gerrit-to-redis
Gerrit-Branch: master
Gerrit-Owner: Yuvipanda <[email protected]>
Gerrit-Reviewer: Yuvipanda <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to