Skip to content

Commit

Permalink
changed back to seconds and added retry
Browse files Browse the repository at this point in the history
  • Loading branch information
pcriadoperez committed Dec 16, 2022
1 parent 45de6d3 commit 20c19f4
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions js/gemini.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ module.exports = class gemini extends Exchange {
},
'options': {
'fetchMarketsMethod': 'fetch_markets_from_web',
'fetchMarketFromWebRetries': 10,
'fetchMarketsFromAPI': {
'fetchDetailsForAllSymbols': false,
'fetchDetailsForMarketIds': [],
Expand Down Expand Up @@ -275,7 +276,21 @@ module.exports = class gemini extends Exchange {
}

async fetchMarketsFromWeb (params = {}) {
const response = await this.webGetRestApi (params);
// This endpoint so we retry
const maxRetries = this.safeInteger (this.options, 'fetchMarketFromWebRetries', 10);
let response = undefined;
let retry = 0;
while (retry < maxRetries) {
try {
response = await this.webGetRestApi (params);
break;
} catch (e) {
retry = retry + 1;
if (retry === maxRetries) {
throw e;
}
}
}
const sections = response.split ('<h1 id="symbols-and-minimums">Symbols and minimums</h1>');
const numSections = sections.length;
const error = this.id + ' fetchMarketsFromWeb() the ' + this.name + ' API doc HTML markup has changed, breaking the parser of order limits and precision info for ' + this.name + ' markets.';
Expand Down Expand Up @@ -1402,7 +1417,7 @@ module.exports = class gemini extends Exchange {
}

nonce () {
return this.seconds ();
return this.milliseconds ();
}

async fetchTransactions (code = undefined, since = undefined, limit = undefined, params = {}) {
Expand Down

0 comments on commit 20c19f4

Please sign in to comment.