Browse Source

delete pubsub subscription on shutdown

Grant Limberg 4 ngày trước cách đây
mục cha
commit
f51bfdb666
1 tập tin đã thay đổi với 5 bổ sung0 xóa
  1. 5 0
      nonfree/controller/PubSubListener.cpp

+ 5 - 0
nonfree/controller/PubSubListener.cpp

@@ -73,6 +73,11 @@ PubSubListener::~PubSubListener()
 	if (_subscriberThread.joinable()) {
 		_subscriberThread.join();
 	}
+
+	auto status = _adminClient.DeleteSubscription(_subscription.FullName());
+	if (! status.ok()) {
+		fprintf(stderr, "Failed to delete subscription: %s\n", status.message().c_str());
+	}
 }
 
 void PubSubListener::subscribe()