chore: deprecate old unused tables
This commit is contained in:
parent
ec30811de1
commit
152fe786b9
3 changed files with 12 additions and 12 deletions
|
|
@ -456,13 +456,6 @@ function plugins (settings, deviceId) {
|
||||||
.catch(logger.error)
|
.catch(logger.error)
|
||||||
}
|
}
|
||||||
|
|
||||||
function pong () {
|
|
||||||
return db.none(`UPDATE server_events SET created=now() WHERE event_type=$1;
|
|
||||||
INSERT INTO server_events (event_type) SELECT $1
|
|
||||||
WHERE NOT EXISTS (SELECT 1 FROM server_events WHERE event_type=$1);`, ['ping'])
|
|
||||||
.catch(logger.error)
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Trader functions
|
* Trader functions
|
||||||
*/
|
*/
|
||||||
|
|
@ -935,7 +928,6 @@ function plugins (settings, deviceId) {
|
||||||
getPhoneCode,
|
getPhoneCode,
|
||||||
getEmailCode,
|
getEmailCode,
|
||||||
executeTrades,
|
executeTrades,
|
||||||
pong,
|
|
||||||
clearOldLogs,
|
clearOldLogs,
|
||||||
notifyConfirmation,
|
notifyConfirmation,
|
||||||
sweepHd,
|
sweepHd,
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,6 @@ const configManager = require('./new-config-manager')
|
||||||
const complianceTriggers = require('./compliance-triggers')
|
const complianceTriggers = require('./compliance-triggers')
|
||||||
const settingsLoader = require('./new-settings-loader')
|
const settingsLoader = require('./new-settings-loader')
|
||||||
const NodeCache = require('node-cache')
|
const NodeCache = require('node-cache')
|
||||||
const util = require('util')
|
|
||||||
const db = require('./db')
|
const db = require('./db')
|
||||||
const processBatches = require('./tx-batching-processing')
|
const processBatches = require('./tx-batching-processing')
|
||||||
|
|
||||||
|
|
@ -24,7 +23,6 @@ const LIVE_INCOMING_TX_INTERVAL = 5 * T.seconds
|
||||||
const UNNOTIFIED_INTERVAL = 10 * T.seconds
|
const UNNOTIFIED_INTERVAL = 10 * T.seconds
|
||||||
const SWEEP_HD_INTERVAL = 5 * T.minute
|
const SWEEP_HD_INTERVAL = 5 * T.minute
|
||||||
const TRADE_INTERVAL = 60 * T.seconds
|
const TRADE_INTERVAL = 60 * T.seconds
|
||||||
const PONG_INTERVAL = 10 * T.seconds
|
|
||||||
const LOGS_CLEAR_INTERVAL = 1 * T.day
|
const LOGS_CLEAR_INTERVAL = 1 * T.day
|
||||||
const SANCTIONS_INITIAL_DOWNLOAD_INTERVAL = 5 * T.minutes
|
const SANCTIONS_INITIAL_DOWNLOAD_INTERVAL = 5 * T.minutes
|
||||||
const SANCTIONS_UPDATE_INTERVAL = 1 * T.day
|
const SANCTIONS_UPDATE_INTERVAL = 1 * T.day
|
||||||
|
|
@ -224,7 +222,6 @@ function addToQueue (func, interval, queue, ...vars) {
|
||||||
|
|
||||||
function doPolling () {
|
function doPolling () {
|
||||||
pi().executeTrades()
|
pi().executeTrades()
|
||||||
pi().pong()
|
|
||||||
pi().clearOldLogs()
|
pi().clearOldLogs()
|
||||||
cashOutTx.monitorLiveIncoming(settings())
|
cashOutTx.monitorLiveIncoming(settings())
|
||||||
cashOutTx.monitorStaleIncoming(settings())
|
cashOutTx.monitorStaleIncoming(settings())
|
||||||
|
|
@ -241,7 +238,6 @@ function doPolling () {
|
||||||
addToQueue(cashInTx.monitorPending, PENDING_INTERVAL, QUEUE.FAST, settings)
|
addToQueue(cashInTx.monitorPending, PENDING_INTERVAL, QUEUE.FAST, settings)
|
||||||
addToQueue(processBatches, UNNOTIFIED_INTERVAL, QUEUE.FAST, settings, TRANSACTION_BATCH_LIFECYCLE)
|
addToQueue(processBatches, UNNOTIFIED_INTERVAL, QUEUE.FAST, settings, TRANSACTION_BATCH_LIFECYCLE)
|
||||||
addToQueue(pi().sweepHd, SWEEP_HD_INTERVAL, QUEUE.FAST, settings)
|
addToQueue(pi().sweepHd, SWEEP_HD_INTERVAL, QUEUE.FAST, settings)
|
||||||
addToQueue(pi().pong, PONG_INTERVAL, QUEUE.FAST)
|
|
||||||
addToQueue(pi().clearOldLogs, LOGS_CLEAR_INTERVAL, QUEUE.SLOW)
|
addToQueue(pi().clearOldLogs, LOGS_CLEAR_INTERVAL, QUEUE.SLOW)
|
||||||
addToQueue(notifier.checkNotification, CHECK_NOTIFICATION_INTERVAL, QUEUE.FAST, pi)
|
addToQueue(notifier.checkNotification, CHECK_NOTIFICATION_INTERVAL, QUEUE.FAST, pi)
|
||||||
addToQueue(initialSanctionsDownload, SANCTIONS_INITIAL_DOWNLOAD_INTERVAL, QUEUE.SLOW)
|
addToQueue(initialSanctionsDownload, SANCTIONS_INITIAL_DOWNLOAD_INTERVAL, QUEUE.SLOW)
|
||||||
|
|
|
||||||
12
migrations/1743526540370-deprecate-tables.js
Normal file
12
migrations/1743526540370-deprecate-tables.js
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
const db = require('./db')
|
||||||
|
|
||||||
|
exports.up = next => db.multi([
|
||||||
|
'DROP TABLE aggregated_machine_pings;',
|
||||||
|
'DROP TABLE cash_in_refills;',
|
||||||
|
'DROP TABLE cash_out_refills;',
|
||||||
|
'DROP TABLE customer_compliance_persistence;',
|
||||||
|
'DROP TABLE compliance_overrides_persistence;',
|
||||||
|
'DROP TABLE server_events;',
|
||||||
|
], next)
|
||||||
|
|
||||||
|
exports.down = next => next()
|
||||||
Loading…
Add table
Add a link
Reference in a new issue