Skip to content

Commit c317abe

Browse files
committed
fix: add cache decorator when getting ip address
1 parent a4ed960 commit c317abe

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/services/ip-service.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1+
import { cache } from "../common/decorators";
2+
13
export class IPService implements IIPService {
24
private static GET_IP_TIMEOUT = 1000;
35
constructor(private $config: IConfiguration,
46
private $httpClient: Server.IHttpClient,
57
private $logger: ILogger) { }
68

9+
@cache()
710
public async getCurrentIPv4Address(): Promise<string> {
811
const ipAddress = await this.getIPAddressFromServiceReturningJSONWithIPProperty(this.$config.WHOAMI_URL_ENDPOINT) ||
912
await this.getIPAddressFromServiceReturningJSONWithIPProperty("https://api.myip.com") ||

0 commit comments

Comments
 (0)