-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
max_memory_restart in StartOptions should be string, not number #3883
Comments
After reading through the source, it seems to default to bytes, so I'm using those for now. Additionally, it seems |
Hi @cfi2017 What do you mean by wait_ready is not supported ? |
It doesn't look like it's defined as a type. It seems to work if I create a startOptions object like this: const startOptions: StartOptions = {} as StartOptions; and then add startOptions['wait_ready'] = true; Additionally, it seems I can add My full configuration and launching script is as follows: (In this example, max_memory_restart has no effect.) const startOptions: StartOptions = {
script: 'target/index.js',
name: 'Worker#' + workerNumber,
kill_timeout: 30000,
watch: true,
max_memory_restart: 4294967296,
autorestart: false,
env: {
NODE_ENV: 'development'
},
args: [output, '--deleteOutput=' + options.deleteOutput, '--selfLaunched']
} as StartOptions;
startOptions['wait_ready'] = true;
pm2.start(startOptions, (err2, apps) => {
// Post-initialization code
}); |
fix: #3883 fix typings for max_memory_restart and add wait_ready
fix: Unitech#3883 fix typings for max_memory_restart and add wait_ready
What's going wrong?
The interface StartOptions defines max_memory_restart to be a number. This causes transpiling to fail when trying to set the value to something like
'200M'
or'2G'
.pm2/types/index.d.ts
Line 351 in 5a8dd7d
How could we reproduce this issue?
Try using the pm2 api with TypeScript and starting a process.
Supporting information
Additionally, it does not seem like
autorestart
is defined as a value of StartOptions.pm2 report output:
The text was updated successfully, but these errors were encountered: