mirror of
https://github.com/appium/appium.git
synced 2026-02-21 02:39:30 -06:00
chore(appium): Bump the amount of max process listeners (#20737)
This commit is contained in:
@@ -45,6 +45,14 @@ import {
|
||||
import net from 'node:net';
|
||||
|
||||
const {resolveAppiumHome} = env;
|
||||
/*
|
||||
* By default Node.js shows a warning
|
||||
* if the actual amount of listeners exceeds the maximum amount,
|
||||
* which equals to 10 by default. It is known that multiple drivers/plugins
|
||||
* may assign custom listeners to the server process to handle, for example,
|
||||
* the graceful shutdown scenario.
|
||||
*/
|
||||
const MAX_SERVER_PROCESS_LISTENERS = 100;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -433,6 +441,7 @@ async function main(args) {
|
||||
throw err;
|
||||
}
|
||||
|
||||
process.setMaxListeners(MAX_SERVER_PROCESS_LISTENERS);
|
||||
for (const signal of ['SIGINT', 'SIGTERM']) {
|
||||
process.once(signal, async function onSignal() {
|
||||
logger.info(`Received ${signal} - shutting down`);
|
||||
|
||||
Reference in New Issue
Block a user