mirror of
https://github.com/OneUptime/oneuptime
synced 2024-11-22 15:24:55 +00:00
18 lines
527 B
TypeScript
18 lines
527 B
TypeScript
import LocalCache from 'CommonServer/Infrastructure/LocalCache';
|
|
import ObjectID from 'Common/Types/ObjectID';
|
|
import BadDataException from 'Common/Types/Exception/BadDataException';
|
|
|
|
export default class ProbeUtil {
|
|
public static getProbeId(): ObjectID {
|
|
const id: string | undefined =
|
|
LocalCache.getString('PROBE', 'PROBE_ID') ||
|
|
process.env['PROBE_ID'];
|
|
|
|
if (!id) {
|
|
throw new BadDataException('Probe ID not found');
|
|
}
|
|
|
|
return new ObjectID(id);
|
|
}
|
|
}
|