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:
commit
dbd34c937c
2 changed files with 0 additions and 9 deletions
|
|
@ -1,9 +1,6 @@
|
||||||
const _ = require('lodash/fp')
|
|
||||||
|
|
||||||
const db = require('../db')
|
const db = require('../db')
|
||||||
const state = require('./state')
|
const state = require('./state')
|
||||||
const newSettingsLoader = require('../new-settings-loader')
|
const newSettingsLoader = require('../new-settings-loader')
|
||||||
const helpers = require('../route-helpers')
|
|
||||||
const logger = require('../logger')
|
const logger = require('../logger')
|
||||||
|
|
||||||
db.connect({ direct: true }).then(sco => {
|
db.connect({ direct: true }).then(sco => {
|
||||||
|
|
@ -80,7 +77,6 @@ const populateSettings = function (req, res, next) {
|
||||||
|
|
||||||
newSettingsLoader.load(versionId)
|
newSettingsLoader.load(versionId)
|
||||||
.then(settings => { req.settings = settings })
|
.then(settings => { req.settings = settings })
|
||||||
.then(() => helpers.updateDeviceConfigVersion(versionId))
|
|
||||||
.then(() => next())
|
.then(() => next())
|
||||||
.catch(next)
|
.catch(next)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -85,14 +85,9 @@ function fetchStatusTx (txId, status) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateDeviceConfigVersion (versionId) {
|
|
||||||
return db.none('update devices set user_config_id=$1', [versionId])
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
stateChange,
|
stateChange,
|
||||||
fetchPhoneTx,
|
fetchPhoneTx,
|
||||||
fetchStatusTx,
|
fetchStatusTx,
|
||||||
updateDeviceConfigVersion,
|
|
||||||
httpError
|
httpError
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue