コード例 #1
0
ファイル: GeoTests.cs プロジェクト: aamarber/Exceptionless
        public GeoTests() {
            var dataDirectory = PathHelper.ExpandPath(".\\");
            var storage = new FolderFileStorage(dataDirectory);

            if (!storage.ExistsAsync(MindMaxGeoIPResolver.GEO_IP_DATABASE_PATH).Result) {
                var job = new DownloadGeoIPDatabaseJob(storage).Run();
                Assert.NotNull(job);
                Assert.True(job.IsSuccess);
            }

            _resolver = new MindMaxGeoIPResolver(storage);
        }
コード例 #2
0
ファイル: GeoTests.cs プロジェクト: rpotalara/Exceptionless
        private static async Task<IGeoIpService> GetResolverAsync(ILoggerFactory loggerFactory) {
            if (_service != null)
                return _service;

            var dataDirectory = PathHelper.ExpandPath(".\\");
            var storage = new FolderFileStorage(dataDirectory);

            if (!await storage.ExistsAsync(MaxMindGeoIpService.GEO_IP_DATABASE_PATH)) {
                var job = new DownloadGeoIPDatabaseJob(new InMemoryCacheClient(), storage, loggerFactory);
                var result = await job.RunAsync();
                Assert.NotNull(result);
                Assert.True(result.IsSuccess);
            }

            return _service = new MaxMindGeoIpService(storage, loggerFactory.CreateLogger<MaxMindGeoIpService>());
        }
コード例 #3
0
ファイル: GeoTests.cs プロジェクト: Nangal/Exceptionless
        private async Task<IGeoIPResolver> GetResolverAsync() {
            if (_resolver != null)
                return _resolver;

            var dataDirectory = PathHelper.ExpandPath(".\\");
            var storage = new FolderFileStorage(dataDirectory);

            if (!await storage.ExistsAsync(MindMaxGeoIPResolver.GEO_IP_DATABASE_PATH)) {
                var job = new DownloadGeoIPDatabaseJob(new InMemoryCacheClient(), storage);
                var result = await job.RunAsync();
                Assert.NotNull(result);
                Assert.True(result.IsSuccess);
            }

            return _resolver = new MindMaxGeoIPResolver(storage);
        }