Skip to content

Commit

Permalink
Fix infinite loop on Android
Browse files Browse the repository at this point in the history
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 john32b#4
  • Loading branch information
voepiter committed Jan 3, 2025
1 parent 25be652 commit 58e70f4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/cbae.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

// -------------------------------------------------------;

Expand Down

0 comments on commit 58e70f4

Please sign in to comment.