Skip to content

Commit

Permalink
Allows you to control the automatic initialization of a group of workers
Browse files Browse the repository at this point in the history
  • Loading branch information
rslucena committed May 17, 2024
1 parent c9a0edf commit 7c14408
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/commands/pm2-worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const list = (engine: 'tsx' | 'node') =>

const start = (engine: 'tsx' | 'node', worker: worker) =>
new Promise((resolve, reject) => {
if (worker.activated) return resolve(null)
pm2.start(
{
name: worker.name,
Expand Down
2 changes: 2 additions & 0 deletions src/commands/pm2-workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export interface worker {
tsx: string
node: string
name: string
activated: boolean
options: Omit<pm2.StartOptions, 'name' | 'script'>
}

Expand All @@ -18,6 +19,7 @@ const defaultConfigs: pm2.StartOptions = {

export default <worker[]>[
{
activated: true,
name: 'http:primary:webserver',
tsx: './src/providers/http-webserver.ts',
node: './dist/providers/http-webserver.js',
Expand Down

0 comments on commit 7c14408

Please sign in to comment.