Merge pull request #1381 from chaotixkilla/fix-potential-concurrent-update-during-cashin

Reduce occurrence of concurrent updates on 'devices' table during cash-in transactions
This commit is contained in:
Rafael Taranto 2022-10-06 19:23:50 +01:00 committed by GitHub
commit dbd34c937c
2 changed files with 0 additions and 9 deletions

View file

@ -1,9 +1,6 @@
const _ = require('lodash/fp')
const db = require('../db')
const state = require('./state')
const newSettingsLoader = require('../new-settings-loader')
const helpers = require('../route-helpers')
const logger = require('../logger')
db.connect({ direct: true }).then(sco => {
@ -80,7 +77,6 @@ const populateSettings = function (req, res, next) {
newSettingsLoader.load(versionId)
.then(settings => { req.settings = settings })
.then(() => helpers.updateDeviceConfigVersion(versionId))
.then(() => next())
.catch(next)
}

View file

@ -85,14 +85,9 @@ function fetchStatusTx (txId, status) {
})
}
function updateDeviceConfigVersion (versionId) {
return db.none('update devices set user_config_id=$1', [versionId])
}
module.exports = {
stateChange,
fetchPhoneTx,
fetchStatusTx,
updateDeviceConfigVersion,
httpError
}