return status from publish when relay loses connectivity.

This commit is contained in:
fiatjaf 2023-03-17 16:21:04 -03:00
parent 332ae1ff7f
commit cef5892bce
No known key found for this signature in database
GPG Key ID: BAD43C4BE5C1A3A1

View File

@ -280,6 +280,9 @@ func (r *Relay) Publish(ctx context.Context, event Event) (Status, error) {
// but if it happens because okCallback was called then it might be "succeeded"
// do not return if okCallback is in process
return status, err
case <-r.ConnectionContext.Done():
// same as above, but when the relay loses connectivity entirely
return status, err
}
}
}