mirror of
https://github.com/twofas/2fas-server.git
synced 2024-12-24 01:50:24 +01:00
retry on failure: return last error only
This commit is contained in:
parent
fc82335cbd
commit
6f9b7871cd
@ -100,9 +100,10 @@ func (h *Request2FaTokenHandler) Handle(cmd *Request2FaToken) error {
|
||||
return h.Pusher.Send(context.Background(), notification)
|
||||
},
|
||||
retry.Attempts(5),
|
||||
retry.LastErrorOnly(true),
|
||||
)
|
||||
|
||||
if err != nil && !messaging.IsRegistrationTokenNotRegistered(err) {
|
||||
if err != nil && !messaging.IsUnregistered(err) {
|
||||
logging.WithFields(logging.Fields{
|
||||
"extension_id": extId.String(),
|
||||
"device_id": device.Id.String(),
|
||||
|
@ -66,6 +66,7 @@ func (h *Send2FaTokenHandler) Handle(cmd *Send2FaToken) error {
|
||||
return h.WebsocketClient.SendMessage(uri, message)
|
||||
},
|
||||
retry.Attempts(5),
|
||||
retry.LastErrorOnly(true),
|
||||
)
|
||||
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user