fix(server): fixes models not being automatically loaded
Build & Deploy / build (push) Failing after 1m46s

This commit is contained in:
2026-07-29 15:22:28 +02:00
parent 6b842c3443
commit 2516fa2537
7 changed files with 411 additions and 17 deletions
+43 -14
View File
@@ -834,23 +834,52 @@ internal sealed class ManagementStore
""";
command.Parameters.AddWithValue("$group_id", groupId);
var result = new List<GroupClientInfo>();
using var reader = command.ExecuteReader();
while (reader.Read())
{
result.Add(new GroupClientInfo(
reader.GetInt64(0),
reader.GetString(1),
reader.IsDBNull(2) ? null : reader.GetString(2),
reader.IsDBNull(3) ? null : reader.GetString(3),
reader.IsDBNull(4) ? null : reader.GetString(4),
ReadKeepalivePolicy(reader, 5, 6, 7)));
}
return result;
return ReadGroupClientInfos(command);
}
}
public IReadOnlyList<GroupClientInfo> ListAllGroupClients()
{
if (!_isAvailable)
{
return [];
}
lock (_lock)
{
using var connection = OpenConnection();
using var command = connection.CreateCommand();
command.CommandText = """
SELECT id, group_id, client_id, model, client_pattern,
keepalive_instances_to_keep_alive,
keepalive_max_parallelism_per_client,
keepalive_parallelism_headroom
FROM group_members
ORDER BY client_id, model, client_pattern
""";
return ReadGroupClientInfos(command);
}
}
private List<GroupClientInfo> ReadGroupClientInfos(SqliteCommand command)
{
var result = new List<GroupClientInfo>();
using var reader = command.ExecuteReader();
while (reader.Read())
{
result.Add(new GroupClientInfo(
reader.GetInt64(0),
reader.GetString(1),
reader.IsDBNull(2) ? null : reader.GetString(2),
reader.IsDBNull(3) ? null : reader.GetString(3),
reader.IsDBNull(4) ? null : reader.GetString(4),
ReadKeepalivePolicy(reader, 5, 6, 7)));
}
return result;
}
public GroupClientInfo AddGroupClient(
string groupId,
string? clientId,