Skip to content

Commit

Permalink
Fix row key (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexMacocian authored Nov 25, 2023
1 parent bd9bcc4 commit 865f0b2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
2 changes: 1 addition & 1 deletion GuildWarsPartySearch/Endpoints/LiveFeed.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public LiveFeed(

public override void ConnectionClosed()
{
var scopedLogger = this.logger.CreateScopedLogger(nameof(this.ConnectionInitialized), this.ClientData.Socket.RemoteEndPoint?.ToString() ?? string.Empty);
var scopedLogger = this.logger.CreateScopedLogger(nameof(this.ConnectionClosed), this.ClientData.Socket.RemoteEndPoint?.ToString() ?? string.Empty);
try
{
scopedLogger.LogInformation("Client disconnected");
Expand Down
12 changes: 2 additions & 10 deletions GuildWarsPartySearch/Services/Database/TableStorageDatabase.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
using Azure.Core.Diagnostics;
using Azure.Data.Tables;
using Azure.Data.Tables;
using GuildWarsPartySearch.Common.Models.GuildWars;
using GuildWarsPartySearch.Server.Models;
using GuildWarsPartySearch.Server.Options;
using GuildWarsPartySearch.Server.Services.Database.Models;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using System.Collections.Concurrent;
using System.Core.Extensions;
using System.Extensions;
using System.Threading;

namespace GuildWarsPartySearch.Server.Services.Database;

Expand Down Expand Up @@ -80,7 +77,7 @@ public async Task<bool> SetPartySearches(Campaign campaign, Continent continent,
{
var entries = partySearch.Select(e =>
{
var rowKey = BuildRowKey(e.CharName!, e.PartySize!.Value, e.PartyMaxSize!.Value, e.Npcs!.Value);
var rowKey = e.CharName ?? string.Empty;
return new PartySearchTableEntity
{
PartitionKey = partitionKey,
Expand Down Expand Up @@ -155,9 +152,4 @@ private static string BuildPartitionKey(Campaign campaign, Continent continent,
{
return $"{campaign.Name};{continent.Name};{region.Name};{map.Name};{district}";
}

private static string BuildRowKey(string charName, int partySize, int partyMaxSize, int npcs)
{
return $"{charName};{partySize};{partyMaxSize};{npcs}";
}
}

0 comments on commit 865f0b2

Please sign in to comment.