From 97707c57afa31d9258ad6907eec542af6a47f893 Mon Sep 17 00:00:00 2001 From: Taishi Kasuga Date: Wed, 2 Oct 2024 07:06:10 +0900 Subject: [PATCH] chore: fix a debug script (#393) --- bin/pubsub | 1 + test/test_against_cluster_down.rb | 1 + 2 files changed, 2 insertions(+) diff --git a/bin/pubsub b/bin/pubsub index d1a2697..bd19f38 100755 --- a/bin/pubsub +++ b/bin/pubsub @@ -49,6 +49,7 @@ module PubSubDebug handle_errors('Subscriber') do e = ps.next_event(0.01) log "#{role}: recv: #{e.nil? ? 'nil' : e}" + ps.call('ssubscribe', c) if e.first == 'sunsubscribe' end ensure sleep 1.0 diff --git a/test/test_against_cluster_down.rb b/test/test_against_cluster_down.rb index 3bad738..cf8b78a 100644 --- a/test/test_against_cluster_down.rb +++ b/test/test_against_cluster_down.rb @@ -164,6 +164,7 @@ def spawn_subscriber(cli, rec) event = ps.next_event(0.01) case event&.first when 'smessage' then r.set(event[2]) + when 'sunsubscribe' then ps.call('ssubscribe', 'chan') end end ensure