Skip to content

Commit 91f884c

Browse files
Remove the old search. (#7145)
Clean old search service and configure Search http client timeout.
1 parent 61fed82 commit 91f884c

48 files changed

Lines changed: 72 additions & 1449 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

NuGetGallery.sln

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "2. Tests", "2. Tests", "{39
2222
EndProject
2323
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "0. Shared", "0. Shared", "{155100FF-524B-4CAF-93C6-A57478B3DBAD}"
2424
EndProject
25-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NuGet.Services.Search.Client", "src\NuGet.Services.Search.Client\NuGet.Services.Search.Client.csproj", "{6931C2EE-E081-4518-9798-D34D83B35BF6}"
26-
EndProject
2725
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "4. Tools", "4. Tools", "{2204C510-A559-4ED7-9590-FDC09093575B}"
2826
EndProject
2927
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GalleryTools", "src\GalleryTools\GalleryTools.csproj", "{C5849063-8CDC-4561-BA5C-7D97BD905DC3}"
@@ -60,10 +58,6 @@ Global
6058
{8AC9E39E-366C-47E5-80AE-38E71CD31386}.Debug|Any CPU.Build.0 = Debug|Any CPU
6159
{8AC9E39E-366C-47E5-80AE-38E71CD31386}.Release|Any CPU.ActiveCfg = Release|Any CPU
6260
{8AC9E39E-366C-47E5-80AE-38E71CD31386}.Release|Any CPU.Build.0 = Release|Any CPU
63-
{6931C2EE-E081-4518-9798-D34D83B35BF6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
64-
{6931C2EE-E081-4518-9798-D34D83B35BF6}.Debug|Any CPU.Build.0 = Debug|Any CPU
65-
{6931C2EE-E081-4518-9798-D34D83B35BF6}.Release|Any CPU.ActiveCfg = Release|Any CPU
66-
{6931C2EE-E081-4518-9798-D34D83B35BF6}.Release|Any CPU.Build.0 = Release|Any CPU
6761
{C5849063-8CDC-4561-BA5C-7D97BD905DC3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
6862
{C5849063-8CDC-4561-BA5C-7D97BD905DC3}.Debug|Any CPU.Build.0 = Debug|Any CPU
6963
{C5849063-8CDC-4561-BA5C-7D97BD905DC3}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -97,7 +91,6 @@ Global
9791
{FDC76BEF-3360-45AC-A13E-AE8F14D343D5} = {39E54EC3-CBAA-453A-BE64-748FE1559A58}
9892
{097B2CDD-9623-4C34-93C2-D373D51F5B4E} = {155100FF-524B-4CAF-93C6-A57478B3DBAD}
9993
{8AC9E39E-366C-47E5-80AE-38E71CD31386} = {39E54EC3-CBAA-453A-BE64-748FE1559A58}
100-
{6931C2EE-E081-4518-9798-D34D83B35BF6} = {05998089-58F5-4A84-8C11-C5C6244A6F89}
10194
{C5849063-8CDC-4561-BA5C-7D97BD905DC3} = {2204C510-A559-4ED7-9590-FDC09093575B}
10295
{6262F4FC-29BE-4226-B676-DB391C89D396} = {155100FF-524B-4CAF-93C6-A57478B3DBAD}
10396
{79C831E9-7C88-4B98-B084-4DE940C73FC7} = {39E54EC3-CBAA-453A-BE64-748FE1559A58}

src/GalleryTools/Commands/BackfillCommand.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
using Microsoft.Extensions.CommandLineUtils;
99
using NuGet.Packaging;
1010
using NuGet.Services.Entities;
11-
using NuGet.Services.Search.Client;
1211
using NuGetGallery;
1312
using NuGetGallery.Configuration;
1413
using System;
@@ -20,6 +19,7 @@
2019
using System.Threading.Tasks;
2120
using System.Xml;
2221
using System.Xml.Linq;
22+
using GalleryTools.Utils;
2323

2424
namespace GalleryTools.Commands
2525
{
@@ -43,6 +43,7 @@ public abstract class BackfillCommand<TMetadata>
4343
var collectData = config.Option("-c | --collect", "Collect metadata and save it in a file", CommandOptionType.NoValue);
4444
var updateDB = config.Option("-u | --update", "Update the database with collected metadata", CommandOptionType.NoValue);
4545
var fileName = config.Option("-f | --file", "The file to use", CommandOptionType.SingleValue);
46+
var serviceDiscoveryUri = config.Option("-s | --servicediscoveryuri", "The ServiceDiscoveryUri.", CommandOptionType.SingleValue);
4647

4748
config.HelpOption("-? | -h | --help");
4849

@@ -53,12 +54,12 @@ public abstract class BackfillCommand<TMetadata>
5354
var container = builder.Build();
5455

5556
var connectionString = container.Resolve<IAppConfiguration>().SqlConnectionString;
56-
var serviceDiscoveryUri = container.Resolve<IAppConfiguration>().ServiceDiscoveryUri;
57+
var serviceDiscoveryUriValue = new Uri(serviceDiscoveryUri.Value());
5758

5859
var command = new TCommand();
5960

6061
var metadataFileName = fileName.HasValue() ? fileName.Value() : command.MetadataFileName;
61-
62+
6263
if (collectData.HasValue())
6364
{
6465
var lastCreateTime = DateTime.MaxValue;
@@ -74,7 +75,7 @@ public abstract class BackfillCommand<TMetadata>
7475
}
7576
}
7677

77-
await command.Collect(connectionString, serviceDiscoveryUri, lastCreateTime, metadataFileName);
78+
await command.Collect(connectionString, serviceDiscoveryUriValue, lastCreateTime, metadataFileName);
7879
}
7980

8081
if (updateDB.HasValue())

src/GalleryTools/GalleryTools.csproj

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,12 @@
5353
<Compile Include="Commands\VerifyApiKeyCommand.cs" />
5454
<Compile Include="Program.cs" />
5555
<Compile Include="Properties\AssemblyInfo.cs" />
56+
<Compile Include="Utils\ServiceDiscoveryClient.cs" />
5657
</ItemGroup>
5758
<ItemGroup>
5859
<None Include="App.config" />
5960
</ItemGroup>
6061
<ItemGroup>
61-
<ProjectReference Include="..\NuGet.Services.Search.Client\NuGet.Services.Search.Client.csproj">
62-
<Project>{6931C2EE-E081-4518-9798-D34D83B35BF6}</Project>
63-
<Name>NuGet.Services.Search.Client</Name>
64-
</ProjectReference>
6562
<ProjectReference Include="..\NuGet.Services.Entities\NuGet.Services.Entities.csproj">
6663
<Project>{6262f4fc-29be-4226-b676-db391c89d396}</Project>
6764
<Name>NuGet.Services.Entities</Name>

src/NuGet.Services.Search.Client/Client/ServiceDiscoveryClient.cs renamed to src/GalleryTools/Utils/ServiceDiscoveryClient.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
using System.Threading.Tasks;
99
using Newtonsoft.Json.Linq;
1010

11-
namespace NuGet.Services.Search.Client
11+
namespace GalleryTools.Utils
1212
{
13-
public class ServiceDiscoveryClient : IServiceDiscoveryClient
13+
public class ServiceDiscoveryClient
1414
{
1515
private readonly HttpClient _httpClient;
1616
private readonly Uri _serviceDiscoveryEndpoint;

src/NuGet.Services.Search.Client/Client/BaseUrlHealthIndicatorStore.cs

Lines changed: 0 additions & 107 deletions
This file was deleted.

src/NuGet.Services.Search.Client/Client/IEndpointHealthIndicatorStore.cs

Lines changed: 0 additions & 14 deletions
This file was deleted.

src/NuGet.Services.Search.Client/Client/IHealthIndicatorLogger.cs

Lines changed: 0 additions & 13 deletions
This file was deleted.

src/NuGet.Services.Search.Client/Client/IServiceDiscoveryClient.cs

Lines changed: 0 additions & 21 deletions
This file was deleted.

src/NuGet.Services.Search.Client/Client/NullHealthIndicatorLogger.cs

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)