mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
restart replication if RabbitMQ connection closed
https://github.com/google/go-cloud/issues/2958
This commit is contained in:
parent
770393a48c
commit
0cfed8c3cb
|
@ -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() {
|
||||||
|
|
Loading…
Reference in a new issue