Fix messages infinitely sending.

This was because signal infinitely tries to send message on network errors. Since we already have retrying built into the loki api we just disable this behaviour and set a cap of 3 on PushSendJobs incase.
This commit is contained in:
Mikunj 2019-09-13 11:56:36 +10:00
parent db320be3f0
commit 3dba87198a
4 changed files with 8 additions and 4 deletions

View File

@ -215,7 +215,9 @@ public class PushGroupSendJob extends PushSendJob implements InjectableType {
@Override
public boolean onShouldRetry(@NonNull Exception exception) {
if (exception instanceof IOException) return true;
if (exception instanceof RetryLaterException) return true;
// Loki - Disable since we have our own retrying
// if (exception instanceof RetryLaterException) return true;
return false;
}

View File

@ -179,7 +179,8 @@ public class PushMediaSendJob extends PushSendJob implements InjectableType {
@Override
public boolean onShouldRetry(@NonNull Exception exception) {
if (exception instanceof RetryLaterException) return true;
// Loki - Disable since we have our own retrying
// if (exception instanceof RetryLaterException) return true;
return false;
}

View File

@ -68,7 +68,7 @@ public abstract class PushSendJob extends SendJob {
.setQueue(destination.serialize())
.addConstraint(NetworkConstraint.KEY)
.setLifespan(TimeUnit.DAYS.toMillis(1))
.setMaxAttempts(Parameters.UNLIMITED)
.setMaxAttempts(3)
.build();
}

View File

@ -134,7 +134,8 @@ public class PushTextSendJob extends PushSendJob implements InjectableType {
@Override
public boolean onShouldRetry(@NonNull Exception exception) {
if (exception instanceof RetryLaterException) return true;
// Loki - Disable since we have our own retrying
// if (exception instanceof RetryLaterException) return true;
return false;
}