Skip to content

Commit

Permalink
Merge pull request #4615 from kevindoveton/development
Browse files Browse the repository at this point in the history
fix: Add type for pm2.reload with optional options parameter
  • Loading branch information
Unitech committed Apr 12, 2020
2 parents 73f8f4f + ff5d42c commit e94cde8
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions types/index.d.ts
Expand Up @@ -100,6 +100,19 @@ export {del as delete};
*/
export function reload(process: string|number, errback: ErrProcCallback): void;

/**
* Zero-downtime rolling restart. At least one process will be kept running at
* all times as each instance is restarted individually.
* Only works for scripts started in cluster mode.
* @param process - Can either be the name as given in the pm2.start options,
* a process id, or the string “all” to indicate that all scripts should be restarted.
* @param options - An object containing configuration
* @param options.updateEnv - (Default: false) If true is passed in, pm2 will reload it’s
* environment from process.env before reloading your process.
* @param errback - called when the process is reloaded
*/
export function reload(process: string|number, options: ReloadOptions, errback: ErrProcCallback): void;

/**
* Kills the pm2 daemon (same as pm2 kill). Note that when the daemon is killed, all its
* processes are also killed. Also note that you still have to explicitly disconnect
Expand Down Expand Up @@ -407,6 +420,14 @@ export interface StartOptions {
env?: { [key: string]: string; };
}

interface ReloadOptions {
/**
* (Default: false) If true is passed in, pm2 will reload it’s environment from process.env
* before reloading your process.
*/
updateEnv?: boolean;
}

// Types

type ProcessStatus = 'online' | 'stopping' | 'stopped' | 'launching' | 'errored' | 'one-launch-status';
Expand Down

0 comments on commit e94cde8

Please sign in to comment.