mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-24 08:47:46 +00:00
Update scheduling of ServiceOutageDetectionJob.
Previously, we were running this job in PushSendJob#onCanceled(). However, with the new retry logic, this won't happen for 24 hours. Instead, we now schedule the job in PushSendJob#onRetry().
This commit is contained in:
parent
f1d8fd8838
commit
933be54035
@ -139,8 +139,6 @@ public class PushGroupSendJob extends PushSendJob implements InjectableType {
|
||||
|
||||
@Override
|
||||
public void onCanceled() {
|
||||
super.onCanceled();
|
||||
|
||||
DatabaseFactory.getMmsDatabase(context).markAsSentFailed(messageId);
|
||||
}
|
||||
|
||||
|
@ -94,8 +94,6 @@ public class PushMediaSendJob extends PushSendJob implements InjectableType {
|
||||
|
||||
@Override
|
||||
public void onCanceled() {
|
||||
super.onCanceled();
|
||||
|
||||
DatabaseFactory.getMmsDatabase(context).markAsSentFailed(messageId);
|
||||
notifyMediaMessageDeliveryFailed(context, messageId);
|
||||
}
|
||||
|
@ -74,8 +74,12 @@ public abstract class PushSendJob extends SendJob {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCanceled() {
|
||||
ApplicationContext.getInstance(context).getJobManager().add(new ServiceOutageDetectionJob(context));
|
||||
public void onRetry() {
|
||||
super.onRetry();
|
||||
|
||||
if (getRunIteration() > 1) {
|
||||
ApplicationContext.getInstance(context).getJobManager().add(new ServiceOutageDetectionJob(context));
|
||||
}
|
||||
}
|
||||
|
||||
protected Optional<byte[]> getProfileKey(@NonNull Recipient recipient) {
|
||||
|
@ -83,8 +83,6 @@ public class PushTextSendJob extends PushSendJob implements InjectableType {
|
||||
|
||||
@Override
|
||||
public void onCanceled() {
|
||||
super.onCanceled();
|
||||
|
||||
DatabaseFactory.getSmsDatabase(context).markAsSentFailed(messageId);
|
||||
|
||||
long threadId = DatabaseFactory.getSmsDatabase(context).getThreadIdForMessage(messageId);
|
||||
|
Loading…
x
Reference in New Issue
Block a user