mirror of
https://github.com/Redume/Kekkai.git
synced 2025-02-22 20:23:12 +03:00
chore(collect-currency): Removed checking for duplicate currency exchange rates over time.
This commit is contained in:
parent
3720c3d66f
commit
fff7cebdb7
2 changed files with 0 additions and 22 deletions
|
@ -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)`,
|
||||
[
|
||||
|
|
|
@ -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)`,
|
||||
[
|
||||
|
|
Loading…
Add table
Reference in a new issue