fix: enqueue sweeping requests and loosen sweep polling
This commit is contained in:
parent
ecdc020113
commit
fa0ef6b053
3 changed files with 12 additions and 4 deletions
|
|
@ -806,8 +806,8 @@ function plugins (settings, deviceId) {
|
|||
}
|
||||
|
||||
function sweepHd () {
|
||||
const sql = `select id, crypto_code, hd_index from cash_out_txs
|
||||
where hd_index is not null and not swept and status in ('confirmed', 'instant')`
|
||||
const sql = `SELECT id, crypto_code, hd_index FROM cash_out_txs
|
||||
WHERE hd_index IS NOT NULL AND NOT swept AND status IN ('confirmed', 'instant') AND created < now() - interval '1 week'`
|
||||
|
||||
return db.any(sql)
|
||||
.then(rows => Promise.all(rows.map(sweepHdRow)))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue