mirror of
https://github.com/Redume/Kekkai.git
synced 2025-02-23 20:51:25 +03:00
исправил ошибку при которой не все пары валют добавлялсь в бд
This commit is contained in:
parent
874c7ac1f1
commit
394062ab72
1 changed files with 2 additions and 2 deletions
|
@ -2,7 +2,6 @@ const pool = require("../postgresql.js");
|
||||||
const yaml = require("yaml")
|
const yaml = require("yaml")
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
const axios = require("axios");
|
const axios = require("axios");
|
||||||
const {AxiosProxyConfig} = require("axios");
|
|
||||||
const config = yaml.parse(fs.readFileSync("./config.yaml", "utf-8"));
|
const config = yaml.parse(fs.readFileSync("./config.yaml", "utf-8"));
|
||||||
|
|
||||||
async function saveRate() {
|
async function saveRate() {
|
||||||
|
@ -34,9 +33,10 @@ async function saveRate() {
|
||||||
|
|
||||||
const point = data['to'][0]['mid'].toString().indexOf('.') + 4;
|
const point = data['to'][0]['mid'].toString().indexOf('.') + 4;
|
||||||
|
|
||||||
pool.query('SELECT * FROM currency WHERE from_currency = $1 AND date = $2',
|
pool.query('SELECT * FROM currency WHERE from_currency = $1 AND conv_currency = $2 AND date = $3',
|
||||||
[
|
[
|
||||||
value,
|
value,
|
||||||
|
pair,
|
||||||
new Date(data['timestamp']).toLocaleDateString()
|
new Date(data['timestamp']).toLocaleDateString()
|
||||||
]
|
]
|
||||||
).then(async (db) => {
|
).then(async (db) => {
|
||||||
|
|
Loading…
Add table
Reference in a new issue