Skip to content

Commit

Permalink
🔧 Change retry timeout to default
Browse files Browse the repository at this point in the history
  • Loading branch information
helianthuswhite committed Apr 22, 2020
1 parent b0c3e5a commit 7a7f47d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 25 deletions.
32 changes: 10 additions & 22 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "@baiducloud/restclient",
"version": "1.0.1",
"version": "1.0.2",
"description": "Restful HTTP Client for broswer.",
"main": "dist/index.js",
"typings": "types/main.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion src/decorators/retry.ts
Expand Up @@ -12,7 +12,7 @@ import plugins from '../plugins';
const {retry} = plugins;

/* eslint-disable arrow-body-style */
export default (times = 2, timeout: number = 5 * 1000, condition?: Function): Function => {
export default (times: number = 2, timeout?: number, condition?: Function): Function => {
return (target: any, key?: string, descriptor?: PropertyDescriptor): void => {
timeoutDecorator(timeout)(target, key, descriptor);
use('response', retry(condition, times), 1)(target, key, descriptor);
Expand Down

0 comments on commit 7a7f47d

Please sign in to comment.