mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-09-19 14:27:58 +08:00
restart replication if RabbitMQ connection closed
https://github.com/google/go-cloud/issues/2958
This commit is contained in:
@@ -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) {
|
func (k *GoCDKPubSubInput) ReceiveMessage() (key string, message *filer_pb.EventNotification, onSuccessFn func(), onFailureFn func(), err error) {
|
||||||
msg, err := k.sub.Receive(context.Background())
|
msg, err := k.sub.Receive(context.Background())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
var conn *amqp.Connection
|
||||||
|
if k.sub.As(&conn) && conn.IsClosed() {
|
||||||
|
glog.Fatalln(err)
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
onFailureFn = func() {
|
onFailureFn = func() {
|
||||||
|
Reference in New Issue
Block a user