fix: BotDiscoveryService now actually saves discovery status to database
All checks were successful
Build and Deploy LittleShop / Deploy to Production VPS (Manual Only) (push) Has been skipped
Build and Deploy LittleShop / Deploy to Pre-Production (CT109) (push) Successful in 1m2s

The UpdateBotDiscoveryStatus method was a stub that only logged but never
saved the RemoteAddress, RemotePort, DiscoveryStatus, and RemoteInstanceId
to the database. Now it properly calls UpdateRemoteInfoAsync.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
SysAdmin 2025-11-25 17:24:54 +00:00
parent a975a9e914
commit bd0714e920

View File

@ -417,12 +417,15 @@ public class BotDiscoveryService : IBotDiscoveryService
private async Task UpdateBotDiscoveryStatus(Guid botId, string status, string ipAddress, int port, string? instanceId) private async Task UpdateBotDiscoveryStatus(Guid botId, string status, string ipAddress, int port, string? instanceId)
{ {
var bot = await _botService.GetBotByIdAsync(botId); var success = await _botService.UpdateRemoteInfoAsync(botId, ipAddress, port, instanceId, status);
if (bot != null) if (success)
{ {
// Update via direct database access would be better, but for now use a workaround _logger.LogInformation("Updated bot {BotId} discovery status to {Status} at {Address}:{Port}",
// This would typically be done through a dedicated method on IBotService botId, status, ipAddress, port);
_logger.LogInformation("Updating bot {BotId} discovery status to {Status}", botId, status); }
else
{
_logger.LogWarning("Failed to update discovery status for bot {BotId}", botId);
} }
} }