refactor: single pass through received frames
This commit is contained in:
parent
c3688f975a
commit
77347ff29c
1 changed files with 3 additions and 4 deletions
|
|
@ -683,11 +683,10 @@ function updateDiagnostics(deviceId, images) {
|
|||
const updateFailedQRScans = (deviceId, frames) => {
|
||||
const timestamp = new Date().toISOString()
|
||||
const directory = `${OPERATOR_DATA_DIR}/failedQRScans/${deviceId}/`
|
||||
const filenames = _.map(
|
||||
no => `${timestamp}-${no}.jpg`,
|
||||
_.range(0, _.size(frames)),
|
||||
return updatePhotos(
|
||||
directory,
|
||||
frames.map((frame, no) => [`${timestamp}-${no}.jpg`, frame]),
|
||||
)
|
||||
return updatePhotos(directory, _.zip(filenames, frames))
|
||||
}
|
||||
|
||||
function createPhoto(name, data, dir) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue