diff --git a/apps/reader/models.py b/apps/reader/models.py index a5919de4a..3b8765809 100644 --- a/apps/reader/models.py +++ b/apps/reader/models.py @@ -201,8 +201,6 @@ class UserSubscription(models.Model): results = pipeline.execute() - if store_stories_key: - r.zunionstore(store_stories_key, unread_ranked_stories_keys, aggregate="MAX") for hashes in results: if not isinstance(hashes, list): continue @@ -211,6 +209,9 @@ class UserSubscription(models.Model): feed_counter += 1 else: story_hashes.extend(hashes) + + if store_stories_key: + r.zunionstore(store_stories_key, unread_ranked_stories_keys, aggregate="MAX") return story_hashes diff --git a/docker/haproxy/haproxy.consul.cfg.j2 b/docker/haproxy/haproxy.consul.cfg.j2 index df20a2cd4..19e9713ab 100644 --- a/docker/haproxy/haproxy.consul.cfg.j2 +++ b/docker/haproxy/haproxy.consul.cfg.j2 @@ -146,6 +146,14 @@ backend sentry server {{host}} {{host}}.node.nyc1.consul:9000 {% endfor %} +backend staging + balance roundrobin + option httpchk GET /_haproxychk + default-server check inter 2000ms resolvers consul resolve-prefer ipv4 resolve-opts allow-dup-ip init-addr none + {% for host in groups.staging %} + server {{host}} {{host}}.node.nyc1.consul:8000 + {% endfor %} + backend node_images option httpchk HEAD /sc,seLJDaKBog3LLEMDe8cjBefMhnVSibO4RA5boZhWcVZ0=/https://samuelclay.com/static/images/2019%20-%20Cuba.jpg http-check expect rstatus 200|301