Skip to content

Commit

Permalink
Remove duplicated spawn code
Browse files Browse the repository at this point in the history
  • Loading branch information
mia-pi-git committed Nov 5, 2023
1 parent 56a5175 commit a337730
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions server/private-messages/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,28 +209,6 @@ export const PrivateMessages = new class {
}
};

if (Config.usesqlite) {
if (PM.isParentProcess) {
PM.spawn(Config.pmprocesses || 1);
// clear super old pms on startup
void PM.run(statements.clearDated);
} else {
global.Monitor = {
crashlog(error: Error, source = 'A private message child process', details: AnyObject | null = null) {
const repr = JSON.stringify([error.name, error.message, source, details]);
process.send!(`THROW\n@!!@${repr}\n${error.stack}`);
},
};
process.on('uncaughtException', err => {
Monitor.crashlog(err, 'A private message database process');
});
process.on('unhandledRejection', err => {
Monitor.crashlog(err as Error, 'A private message database process');
});
}
}


if (Config.usesqlite) {
if (!process.send) {
PM.spawn(Config.pmprocesses || 1);
Expand Down

0 comments on commit a337730

Please sign in to comment.