单个模块的运行态(纯读内存,不做进程探测)。bin 为实例唯一键
(type: string)
| 50 | |
| 51 | /** 单个模块的运行态(纯读内存,不做进程探测)。bin 为实例唯一键 */ |
| 52 | statusOf(type: string): ServiceStatusItem { |
| 53 | const list = (this.servicePID[type] ?? []).filter((i) => !!i.pid) |
| 54 | const instances: RunningInstance[] = list.map((i) => ({ |
| 55 | bin: i.item?.bin, |
| 56 | path: i.item?.path, |
| 57 | version: i.item?.version ?? undefined, |
| 58 | pid: i.pid |
| 59 | })) |
| 60 | return { |
| 61 | flag: type, |
| 62 | running: instances.length > 0, |
| 63 | instances |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | /** 批量查询运行态。flags 省略则返回当前所有有记录的模块 */ |
| 68 | getStatus(flags?: string[]): Record<string, ServiceStatusItem> { |
no outgoing calls
no test coverage detected