Fixed worker termination and result retrieving
This commit is contained in:
@@ -8,11 +8,11 @@ parentPort.on("message", async (data) => {
|
||||
const creator = new NameCardCreator(templatePath);
|
||||
const buffer = await creator.getWelcomeCard(avatarURL, username);
|
||||
|
||||
console.log(buffer);
|
||||
|
||||
parentPort.postMessage({ result: buffer });
|
||||
|
||||
} catch (err) {
|
||||
parentPort.postMessage({ error: err.message });
|
||||
} finally {
|
||||
parentPort.close();
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user