async function handleEvent()

in monitoring/remoteRun.ts [61:83]


	async function handleEvent(userInput: RemoteRunCLIUserInput) {
		const invokeSettledResults = await Promise.allSettled(
			userInput.regions.map((region) =>
				invokeInRegion(
					region,
					'cmp-monitoring-CODE',
					userInput.stage,
				),
			),
		);

		invokeSettledResults.map((result) => {
			if (result.status == 'fulfilled') {
				processResult(result.value);
			} else {
				console.log('------------------------------------------');
				console.log('Failed to get response: ', result.reason);
				console.log('------------------------------------------');
			}
		});

		process.exit(0);
	}