From 3b8f47a161cd35256852b9cd8680fcd4e9652617 Mon Sep 17 00:00:00 2001 From: WolverinDEV Date: Sat, 20 Feb 2021 16:10:13 +0100 Subject: [PATCH] Don't start the client geoservice if it's not required --- src/GeoLocation.ts | 6 ++++-- src/index.ts | 6 ++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/GeoLocation.ts b/src/GeoLocation.ts index bfc3306..3d34182 100644 --- a/src/GeoLocation.ts +++ b/src/GeoLocation.ts @@ -160,5 +160,7 @@ class GeoResolverIpInfo implements GeoLocationResolver { export let geoLocationProvider: GeoLocationProvider; -geoLocationProvider = new GeoLocationProvider(); -geoLocationProvider.loadCache(); \ No newline at end of file +export function initializeGeoService() { + geoLocationProvider = new GeoLocationProvider(); + geoLocationProvider.loadCache(); +} \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 37571ac..1cd3637 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,3 +1,5 @@ +import {initializeGeoService} from "./GeoLocation"; + export { ClientServiceLogger, setClientServiceLogger } from "./Logging"; export { ActionResult } from "./Action"; @@ -8,3 +10,7 @@ export * as Messages from "./Messages"; export { ClientServiceInvite, InviteLinkInfo } from "./ClientServiceInvite"; export { ClientServiceConfig, ClientServices, LocalAgent } from "./ClientService"; + +export function initializeClientServices() { + initializeGeoService(); +} \ No newline at end of file