Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
catusf committed Nov 15, 2024
1 parent 30e02fd commit 9f71cb2
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function generateSvg(data, config) {
}

// Split data into chunks for parallel processing
const chunkSize = Math.ceil(data.length / os.cpus().length) // Distribute work by CPU cores
const chunkSize = Math.ceil(data.length / os.cpus().length) // Distribute work by CPU cores
const chunks = []

for (let i = 0; i < data.length; i += chunkSize) {
Expand All @@ -35,19 +35,19 @@ function generateSvg(data, config) {
chunk,
config,
baseEngine,
rubyEngine,
},
rubyEngine
}
})

worker.on('message', (result) => {
worker.on('message', result => {
console.log(result)
})

worker.on('error', (error) => {
worker.on('error', error => {
console.error('Worker error:', error)
})

worker.on('exit', (exitCode) => {
worker.on('exit', exitCode => {
if (exitCode !== 0) {
console.error(`Worker stopped with exit code ${exitCode}`)
}
Expand All @@ -61,7 +61,7 @@ if (!isMainThread) {
const fs = require('fs')
const svg = require('svg')

chunk.forEach((char) => {
chunk.forEach(char => {
const svgContent = svg.wrap(
ruby.getBase(baseEngine, char.glyph, config.layout.base),
ruby.getRuby(rubyEngine, char.ruby, config.layout.ruby)
Expand Down

0 comments on commit 9f71cb2

Please sign in to comment.