Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
TangKuPos
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王海
TangKuPos
Commits
e554aa35
Commit
e554aa35
authored
Mar 14, 2018
by
zhang_z
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
百富重试次数为6,时间间隔为5s;
parent
2d07da59
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
3 deletions
+8
-3
pay/src/main/java/com/xingdata/zxpay/api/RetryHelper.java
pay/src/main/java/com/xingdata/zxpay/api/RetryHelper.java
+1
-1
pay/src/main/java/com/xingdata/zxpay/pax/C.java
pay/src/main/java/com/xingdata/zxpay/pax/C.java
+6
-1
pay/src/main/java/com/xingdata/zxpay/pax/Factory.java
pay/src/main/java/com/xingdata/zxpay/pax/Factory.java
+1
-1
No files found.
pay/src/main/java/com/xingdata/zxpay/api/RetryHelper.java
View file @
e554aa35
...
@@ -31,7 +31,7 @@ public class RetryHelper implements Function<Observable<Throwable>, ObservableSo
...
@@ -31,7 +31,7 @@ public class RetryHelper implements Function<Observable<Throwable>, ObservableSo
LogUtils
.
e
(
"重试时间:"
+
retryTime
+
"重试:"
+
nowCount
);
LogUtils
.
e
(
"重试时间:"
+
retryTime
+
"重试:"
+
nowCount
);
return
Observable
.
timer
(
retryTime
,
TimeUnit
.
MILLISECONDS
);
return
Observable
.
timer
(
retryTime
,
TimeUnit
.
MILLISECONDS
);
}
}
return
Observable
.
error
(
throwable
);
return
Observable
.
error
(
new
IOException
(
"支付超时"
)
);
}
else
{
}
else
{
return
Observable
.
error
(
throwable
);
return
Observable
.
error
(
throwable
);
}
}
...
...
pay/src/main/java/com/xingdata/zxpay/pax/C.java
View file @
e554aa35
...
@@ -6,10 +6,15 @@ class C {
...
@@ -6,10 +6,15 @@ class C {
*/
*/
static
final
String
VERSION
=
"V1.0"
;
static
final
String
VERSION
=
"V1.0"
;
/**
* 重试次数
*/
static
final
int
RETRY_COUNT
=
6
;
/**
/**
* 重试延迟时间
* 重试延迟时间
*/
*/
static
final
int
RETRY_DELAY_TIME
=
60
*
1000
;
static
final
int
RETRY_DELAY_TIME
=
5
*
1000
;
/**
/**
* 测试数据
* 测试数据
...
...
pay/src/main/java/com/xingdata/zxpay/pax/Factory.java
View file @
e554aa35
...
@@ -22,7 +22,7 @@ public class Factory extends com.xingdata.zxpay.api.Factory {
...
@@ -22,7 +22,7 @@ public class Factory extends com.xingdata.zxpay.api.Factory {
public
static
<
T
>
Observable
<
T
>
run
(
Observable
<
T
>
observable
)
{
public
static
<
T
>
Observable
<
T
>
run
(
Observable
<
T
>
observable
)
{
return
observable
.
subscribeOn
(
Schedulers
.
io
())
return
observable
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
retryWhen
(
new
RetryHelper
(
3
,
C
.
RETRY_DELAY_TIME
));
.
retryWhen
(
new
RetryHelper
(
C
.
RETRY_COUNT
,
C
.
RETRY_DELAY_TIME
));
}
}
/**
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment