Merge remote-tracking branch 'upstream/release-7.5.0' into chore/merge-release-into-dev-21-16-12
This commit is contained in:
commit
e9b2280fc3
33 changed files with 250 additions and 64 deletions
|
|
@ -29,8 +29,8 @@ const BINARIES = {
|
|||
dir: 'bitcoin-22.0/bin'
|
||||
},
|
||||
ETH: {
|
||||
url: 'https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.10.12-6c4dc6c3.tar.gz',
|
||||
dir: 'geth-linux-amd64-1.10.12-6c4dc6c3'
|
||||
url: 'https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.10.13-7a0c19f8.tar.gz',
|
||||
dir: 'geth-linux-amd64-1.10.13-7a0c19f8'
|
||||
},
|
||||
ZEC: {
|
||||
url: 'https://z.cash/downloads/zcash-4.5.1-1-linux64-debian-stretch.tar.gz',
|
||||
|
|
@ -45,8 +45,8 @@ const BINARIES = {
|
|||
dir: 'litecoin-0.18.1/bin'
|
||||
},
|
||||
BCH: {
|
||||
url: 'https://github.com/bitcoin-cash-node/bitcoin-cash-node/releases/download/v23.1.0/bitcoin-cash-node-23.1.0-x86_64-linux-gnu.tar.gz',
|
||||
dir: 'bitcoin-cash-node-23.1.0/bin',
|
||||
url: 'https://github.com/bitcoin-cash-node/bitcoin-cash-node/releases/download/v24.0.0/bitcoin-cash-node-24.0.0-x86_64-linux-gnu.tar.gz',
|
||||
dir: 'bitcoin-cash-node-24.0.0/bin',
|
||||
files: [['bitcoind', 'bitcoincashd'], ['bitcoin-cli', 'bitcoincash-cli']]
|
||||
},
|
||||
XMR: {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,8 @@
|
|||
const T = require('./time')
|
||||
|
||||
const CASH_OUT_MINIMUM_AMOUNT_OF_CASSETTES = 2
|
||||
const CASH_OUT_MAXIMUM_AMOUNT_OF_CASSETTES = 4
|
||||
|
||||
const anonymousCustomer = {
|
||||
uuid: '47ac1184-8102-11e7-9079-8f13a7117867',
|
||||
name: 'anonymous'
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ function addName (pings, events, config) {
|
|||
const statuses = [
|
||||
getStatus(
|
||||
_.first(pings[machine.deviceId]),
|
||||
_.first(checkStuckScreen(events, machine.name))
|
||||
_.first(checkStuckScreen(events, machine))
|
||||
)
|
||||
]
|
||||
|
||||
|
|
|
|||
|
|
@ -85,12 +85,8 @@ function buildAlerts (pings, balances, events, devices) {
|
|||
alerts.general = _.filter(r => !r.deviceId, balances)
|
||||
_.forEach(device => {
|
||||
const deviceId = device.deviceId
|
||||
const deviceName = device.name
|
||||
const deviceEvents = events.filter(function (eventRow) {
|
||||
return eventRow.device_id === deviceId
|
||||
})
|
||||
const ping = pings[deviceId] || []
|
||||
const stuckScreen = checkStuckScreen(deviceEvents, deviceName)
|
||||
const stuckScreen = checkStuckScreen(events, device)
|
||||
|
||||
alerts.devices = _.set([deviceId, 'balanceAlerts'], _.filter(
|
||||
['deviceId', deviceId],
|
||||
|
|
@ -98,7 +94,7 @@ function buildAlerts (pings, balances, events, devices) {
|
|||
), alerts.devices)
|
||||
alerts.devices[deviceId].deviceAlerts = _.isEmpty(ping) ? stuckScreen : ping
|
||||
|
||||
alerts.deviceNames[deviceId] = deviceName
|
||||
alerts.deviceNames[deviceId] = device.name
|
||||
}, devices)
|
||||
|
||||
return alerts
|
||||
|
|
@ -110,12 +106,13 @@ function checkPings (devices) {
|
|||
return _.zipObject(deviceIds)(pings)
|
||||
}
|
||||
|
||||
function checkStuckScreen (deviceEvents, machineName) {
|
||||
const sortedEvents = _.sortBy(
|
||||
utils.getDeviceTime,
|
||||
_.map(utils.parseEventNote, deviceEvents)
|
||||
)
|
||||
const lastEvent = _.last(sortedEvents)
|
||||
function checkStuckScreen (deviceEvents, machine) {
|
||||
const lastEvent = _.pipe(
|
||||
_.filter(e => e.device_id === machine.deviceId),
|
||||
_.sortBy(utils.getDeviceTime),
|
||||
_.map(utils.parseEventNote),
|
||||
_.last
|
||||
)(deviceEvents)
|
||||
|
||||
if (!lastEvent) return []
|
||||
|
||||
|
|
@ -125,6 +122,7 @@ function checkStuckScreen (deviceEvents, machineName) {
|
|||
if (isIdle) return []
|
||||
|
||||
const age = Math.floor(lastEvent.age)
|
||||
const machineName = machine.name
|
||||
if (age > STALE_STATE) return [{ code: STALE, state, age, machineName }]
|
||||
|
||||
return []
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ function unpair (deviceId) {
|
|||
return db.tx(t =>
|
||||
t.none(`INSERT INTO unpaired_devices(id, device_id, name, model, paired, unpaired)
|
||||
SELECT $1, $2, d.name, d.model, d.created, now()
|
||||
FROM devices d
|
||||
FROM devices d
|
||||
WHERE device_id=$2`
|
||||
, [uuid.v4(), deviceId])
|
||||
.then(() => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue