Сделал в некоторых местах JSDocs

This commit is contained in:
Данил 2024-08-04 13:55:37 +03:00
parent d36f9a67f3
commit 74947f0409
4 changed files with 40 additions and 6 deletions

View file

@ -2,6 +2,11 @@ const config = require('../config/main.js')();
const axios = require('axios');
const pool = require('../database/postgresql.js');
/**
* Saves exchange rate of the cryptocurrency
* @return {Object}
*/
function save_fiat() {
if (!config['currency']['collecting']['crypto']) return;
const depth = config['currency']['coinapiKeys']
@ -47,6 +52,13 @@ function save_fiat() {
);
}
/**
* Changing API keys
* @param {Array} list - List of all keys
* @param active - Active API key
* @returns {number} - Outputs the number of the key that should work
*/
function rotate_key(list, active) {
return active[0] = (active + 1) % list.length;
}

View file

@ -2,6 +2,10 @@ const pool = require('../database/postgresql.js');
const axios = require('axios');
const config = require('../config/main.js')();
/**
* Saves exchange rate of the fiat currency
* @returns {Object} -
*/
async function save_fiat() {
if (!config['currency']['collecting']['fiat']) return;