Skip to content

Commit

Permalink
server: fix plugin/thread startup messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Koushik Dutta authored and Koushik Dutta committed Jul 31, 2024
1 parent bdc3c20 commit 6c7671d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/src/scrypted-plugin-main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import { RpcMessage } from "./rpc";

function start(mainFilename: string) {
const pluginId = process.argv[3];
console.log('starting plugin', pluginId);
module.paths.push(getPluginNodePath(pluginId));

if (process.argv[2] === 'child-thread') {
console.log('starting thread', pluginId);
worker_threads.parentPort.once('message', message => {
const { port } = message as { port: worker_threads.MessagePort };
const peer = startPluginRemote(mainFilename, pluginId, (message, reject) => {
Expand All @@ -36,6 +36,7 @@ function start(mainFilename: string) {
});
}
else {
console.log('starting plugin', pluginId);
const peer = startPluginRemote(mainFilename, process.argv[3], (message, reject, serializationContext) => process.send(message, serializationContext?.sendHandle, {
swallowErrors: !reject,
}, e => {
Expand Down

0 comments on commit 6c7671d

Please sign in to comment.