Skip to content

Commit a2ac8ae

Browse files
author
huangliling
committed
feat: ArchivedRequests: sendArchivedRequest retries only if LCException httpStatus is 0, 429, 499, or >= 500
1 parent b943c0d commit a2ac8ae

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

CHANGELOG.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,18 @@ Following is change logs for recently release versions, you can refer to [releas
55
> Warning:
66
> DONOT upgrade java-websocket to 1.15.0(or above), bcz it doesn't work on Android 5.1 or earlier version.
77
8-
## 8.2.24 release
8+
## 8.2.27 release
9+
10+
#### Break changes
11+
- None
12+
13+
#### New features
14+
- ArchivedRequests: sendArchivedRequest retries only if LCException httpStatus is 0, 429, 499, or >= 500
15+
16+
#### Optimization and fixed bugs
17+
- None
18+
19+
## 8.2.26 release
920

1021
#### Break changes
1122
- None

core/src/main/java/cn/leancloud/ArchivedRequests.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,14 @@ public void onNext(LCObject LCObject) {
130130
@Override
131131
public void onError(Throwable throwable) {
132132
logger.w("failed to save archived request. cause: ", throwable);
133+
if (throwable instanceof LCException) {
134+
LCException lcException = (LCException) throwable;
135+
int status = lcException.getHttpStatus();
136+
if (status == 0 || status == 429 || status >= 499) {
137+
return;
138+
}
139+
onNext(null);
140+
}
133141
}
134142

135143
@Override

0 commit comments

Comments
 (0)