-
Notifications
You must be signed in to change notification settings - Fork 24.8k
/
check.ts
39 lines (33 loc) 路 1.27 KB
/
check.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {getCaretakerConfig} from '../config';
import {CiModule} from './ci';
import {G3Module} from './g3';
import {GithubQueriesModule} from './github';
import {ServicesModule} from './services';
/** List of modules checked for the caretaker check command. */
const moduleList = [
GithubQueriesModule,
ServicesModule,
CiModule,
G3Module,
];
/** Check the status of services which Angular caretakers need to monitor. */
export async function checkServiceStatuses() {
/** The configuration for the caretaker commands. */
const config = getCaretakerConfig();
/** List of instances of Caretaker Check modules */
const caretakerCheckModules = moduleList.map(module => new module(config));
// Module's `data` is casted as Promise<unknown> because the data types of the `module`'s `data`
// promises do not match typings, however our usage here is only to determine when the promise
// resolves.
await Promise.all(caretakerCheckModules.map(module => module.data as Promise<unknown>));
for (const module of caretakerCheckModules) {
await module.printToTerminal();
}
}