From 58e70f460479119cb8c56a376c9f5b9d3090568e Mon Sep 17 00:00:00 2001 From: voepiter Date: Thu, 2 Jan 2025 18:03:11 +0300 Subject: [PATCH] Fix infinite loop on Android caused by number of encoding threads DEF_THREADS=0 because node.js os.cpus().length not returning number of cpu cores on Android / Termux Issue #4 --- source/cbae.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/cbae.js b/source/cbae.js index 2f834ad..54cc30e 100644 --- a/source/cbae.js +++ b/source/cbae.js @@ -37,7 +37,7 @@ import {cdinfos} from './cdinfos.js'; // L.set({ date: "", level: 4, file: "/tmp/log_cbae.txt", pos: true, stderr: true }); // Use 3/4 of total threads for operations -const DEF_THREADS = Math.ceil(cpus().length * 0.75); +const DEF_THREADS = (Math.ceil(cpus().length * 0.75)) || 1; // -------------------------------------------------------;