We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a4ed960 commit c317abeCopy full SHA for c317abe
lib/services/ip-service.ts
@@ -1,9 +1,12 @@
1
+import { cache } from "../common/decorators";
2
+
3
export class IPService implements IIPService {
4
private static GET_IP_TIMEOUT = 1000;
5
constructor(private $config: IConfiguration,
6
private $httpClient: Server.IHttpClient,
7
private $logger: ILogger) { }
8
9
+ @cache()
10
public async getCurrentIPv4Address(): Promise<string> {
11
const ipAddress = await this.getIPAddressFromServiceReturningJSONWithIPProperty(this.$config.WHOAMI_URL_ENDPOINT) ||
12
await this.getIPAddressFromServiceReturningJSONWithIPProperty("https://api.myip.com") ||
0 commit comments