Browse Source

restart replication if RabbitMQ connection closed

https://github.com/google/go-cloud/issues/2958
pull/1794/head
Konstantin Lebedev 4 years ago
parent
commit
0cfed8c3cb
  1. 0
      docker/compose/notification.toml
  2. 0
      docker/compose/replication.toml
  3. 4
      weed/replication/sub/notification_gocdk_pub_sub.go

0
docker/notification.toml → docker/compose/notification.toml

0
docker/replication.toml → docker/compose/replication.toml

4
weed/replication/sub/notification_gocdk_pub_sub.go

@ -113,6 +113,10 @@ func (k *GoCDKPubSubInput) Initialize(configuration util.Configuration, prefix s
func (k *GoCDKPubSubInput) ReceiveMessage() (key string, message *filer_pb.EventNotification, onSuccessFn func(), onFailureFn func(), err error) {
msg, err := k.sub.Receive(context.Background())
if err != nil {
var conn *amqp.Connection
if k.sub.As(&conn) && conn.IsClosed() {
glog.Fatalln(err)
}
return
}
onFailureFn = func() {

Loading…
Cancel
Save