The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/app/federation/server/PeerHTTP/utils.js

16 lines
556 B

import { Meteor } from 'meteor/meteor';
// Should skip the retry if the error is one of the below?
const errorsToSkipRetrying = ['error-app-prevented-sending', 'error-decrypt'];
export function skipRetryOnSpecificError(err) {
err = err && err.response && err.response.data && err.response.data.errorType;
return { skip: errorsToSkipRetrying.includes(err), error: err };
}
// Delay method to wait a little bit before retrying
export const delay = Meteor.wrapAsync(function(ms, callback) {
Meteor.setTimeout(function() {
callback(null);
}, ms);
});