Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix row key #5

Merged
merged 1 commit into from
Nov 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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}";
}
}
Loading