Commit 364fd104 authored by nanahira's avatar nanahira

Merge branch 'master' into develop

parents 61edb8d2 4c6a0635
"use strict"; "use strict";
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.retry = retry; exports.retry = retry;
async function retry(fn, count, delayFn = (attempt) => Math.pow(2, attempt) * 1000) { async function retry(fn, count, delayFn = (attempt) => Math.pow(2, attempt) * 100) {
let lastError; let lastError;
for (let attempt = 0; attempt < count; attempt++) { for (let attempt = 0; attempt < count; attempt++) {
try { try {
......
export async function retry<T>( export async function retry<T>(
fn: () => Promise<T>, fn: () => Promise<T>,
count: number, count: number,
delayFn: (attempt: number) => number = (attempt) => Math.pow(2, attempt) * 1000 delayFn: (attempt: number) => number = (attempt) => Math.pow(2, attempt) * 100
): Promise<T> { ): Promise<T> {
let lastError: any; let lastError: any;
......
...@@ -1538,7 +1538,7 @@ class Room ...@@ -1538,7 +1538,7 @@ class Room
headers: headers:
'Content-Type': 'application/x-www-form-urlencoded' 'Content-Type': 'application/x-www-form-urlencoded'
utility.retry post_match_scores, 10 utility.retry post_score_process, 10
.then (response) => .then (response) =>
log.info 'SCORE POST OK', response.status, response.statusText, @name, response.data log.info 'SCORE POST OK', response.status, response.statusText, @name, response.data
......
...@@ -2014,7 +2014,7 @@ ...@@ -2014,7 +2014,7 @@
} }
}); });
}; };
utility.retry(post_match_scores, 10).then((response) => { utility.retry(post_score_process, 10).then((response) => {
return log.info('SCORE POST OK', response.status, response.statusText, this.name, response.data); return log.info('SCORE POST OK', response.status, response.statusText, this.name, response.data);
}).catch((error) => { }).catch((error) => {
if (error.response != null) { if (error.response != null) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment