chore(collect-currency): Removed checking for duplicate currency exchange rates over time.

This commit is contained in:
Данил 2025-01-17 14:49:56 +03:00
parent 3720c3d66f
commit fff7cebdb7
2 changed files with 0 additions and 22 deletions

View file

@ -27,17 +27,6 @@ async function save_crypto() {
const point = data['price'].toString().indexOf('.') + 4;
const db = await pool.query(
'SELECT * FROM currency WHERE ' +
'from_currency = $1 AND conv_currency = $2 AND date = $3',
[
value,
pair,
new Date(data['last_updated']).toISOString().substring(0, 10),
],
);
if (db['rows'][0]) return;
await pool.query(
`INSERT INTO currency (from_currency, conv_currency, rate, date) VALUES ($1, $2, $3, $4)`,
[

View file

@ -31,17 +31,6 @@ async function save_fiat() {
const point =
data['to'][0]['mid'].toString().indexOf('.') + 4;
const db = await pool.query(
'SELECT * FROM currency WHERE ' +
'from_currency = $1 AND conv_currency = $2 AND date = $3',
[
value,
pair,
new Date(data['timestamp']).toISOString().substring(0, 10),
],
);
if (db['rows'][0]) return;
await pool.query(
`INSERT INTO currency (from_currency, conv_currency, rate, date) VALUES ($1, $2, $3, $4)`,
[