Skip to content

Commit fb70251

Browse files
committed
fix: possible out-or-order response objects from batch
1 parent 5ef75e5 commit fb70251

File tree

1 file changed

+2
-4
lines changed
  • src/backend/src/routers/filesystem_api/batch

1 file changed

+2
-4
lines changed

src/backend/src/routers/filesystem_api/batch/all.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -147,16 +147,14 @@ module.exports = eggspress('/batch', {
147147
if ( ! operation_requires_file(op_spec) ) {
148148
indexes_to_remove.push(i);
149149
log.info(`executing ${op_spec.op}`);
150-
response_promises.push(
151-
batch_exe.exec_op(req, op_spec)
152-
);
150+
response_promises[i] = batch_exe.exec_op(req, op_spec);
151+
} else {
153152
}
154153
}
155154

156155
for ( let i=indexes_to_remove.length-1 ; i >= 0 ; i-- ) {
157156
const index = indexes_to_remove[i];
158157
pending_operations.splice(index, 1)[0];
159-
response_promises.splice(index, 1);
160158
}
161159
});
162160

0 commit comments

Comments
 (0)