use accelerator regardless of cpu core count (#5759)

Signed-off-by: si458 <simonsmith5521@gmail.com>

Simon Smith committed Feb 2, 2024 at 10:43 UTC ddcff9f0d2293a1eb3cd17bfa56272469c6fd2dd
1 file changed +8 -13
certoperations.js
+8 -13
@@ -1407,20 +1407,15 @@ module.exports.CertificateOperations = function (parent) {
1407
1408 // Perform any general operation
1409 obj.acceleratorPerformOperation = function (operation, data, tag, func) {
1410 - if (acceleratorTotalCount <= 1) {
1411 - // No accelerators available
1412 - require(program).processMessage({ action: operation, data: data, tag: tag, func: func });
1410 + var acc = obj.getAccelerator();
1411 + if (acc == null) {
1412 + // Add to pending accelerator workload
1413 + acceleratorPerformSignaturePushFuncCall++;
1414 + pendingAccelerator.push({ action: operation, data: data, tag: tag, func: func });
1415 } else {
1414 - var acc = obj.getAccelerator();
1415 - if (acc == null) {
1416 - // Add to pending accelerator workload
1417 - acceleratorPerformSignaturePushFuncCall++;
1418 - pendingAccelerator.push({ action: operation, data: data, tag: tag, func: func });
1419 - } else {
1420 - // Send to accelerator now
1421 - acceleratorPerformSignatureRunFuncCall++;
1422 - acc.send(acc.x = { action: operation, data: data, tag: tag, func: func });
1423 - }
1416 + // Send to accelerator now
1417 + acceleratorPerformSignatureRunFuncCall++;
1418 + acc.send(acc.x = { action: operation, data: data, tag: tag, func: func });
1419 }
1420 };
1421