Skip to content

How do I use the EASY API/CLI with PM2? #2651

Answered by smashah
smashah asked this question in Q&A
Discussion options

You must be logged in to vote

As of V4.35.0, you can now offload the EASY API/CLI process to pm2. This is convenient to bring back sessions upon restarts, managing memory usage, etc.

Examples:

1. Simple offload

Just set --pm2, the name of the process is taken by the --session-id flag (default: @OPEN-WA EASY API)

> npx @open-wa/wa-automate --pm2 --session-id STICKER-BOT

Note: it will not pick up session ID from cli.config.json

If you want to keep your existing session ID but want to change the name of the pm2 process you can use --name flag instead.

> npx @open-wa/wa-automate --pm2 --name STICKER-BOT

2. With PM2 flags

PM2 itself has some powerful features (e.g restarting a process if it reaches a certain memory thres…

Replies: 5 comments 5 replies

Comment options

smashah
Apr 12, 2022
Maintainer Author

You must be logged in to vote
0 replies
Comment options

smashah
Apr 12, 2022
Maintainer Author

You must be logged in to vote
0 replies
Comment options

smashah
Apr 12, 2022
Maintainer Author

You must be logged in to vote
1 reply
@ahmeaqas
Comment options

Answer selected by smashah
Comment options

You must be logged in to vote
1 reply
@smashah
Comment options

smashah Apr 14, 2022
Maintainer Author

Comment options

You must be logged in to vote
3 replies
@smashah
Comment options

smashah Apr 23, 2022
Maintainer Author

@ahmeaqas
Comment options

@smashah
Comment options

smashah Apr 24, 2022
Maintainer Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
PRIORITY Fast track for BMAC Members only.
2 participants
Converted from issue

This discussion was converted from issue #2374 on April 12, 2022 02:30.