Skip to content

Commit d2656b3

Browse files
committed
fix(webapp): read the queue ranking from the queue-metrics ClickHouse client
The Queues list ranking still read through the shared query pool, so on a deployment that puts queue metrics on their own service the ranking query would hit a service without those tables, get swallowed by the fallback, and silently sort by name instead of by activity. Also gives the queue-metrics reader URL a defined fallback, since the query URL is optional.
1 parent 8c517fb commit d2656b3

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

apps/webapp/app/presenters/v3/QueueListPresenter.server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ export class QueueListPresenter extends BasePresenter {
219219

220220
const clickhouse = await clickhouseFactory.getClickhouseForOrganization(
221221
environment.organizationId,
222-
"query"
222+
"queueMetrics"
223223
);
224224

225225
// The window start is aligned to the minute so repeated page loads produce identical

apps/webapp/app/services/clickhouse/clickhouseFactory.server.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,10 @@ function initializeQueueMetricsClickhouseClient(): ClickHouse {
299299
writerUrl.searchParams.delete("secure");
300300

301301
const readerUrl = new URL(
302-
env.QUEUE_METRICS_CLICKHOUSE_READER_URL ?? dedicated ?? env.QUERY_CLICKHOUSE_URL
302+
env.QUEUE_METRICS_CLICKHOUSE_READER_URL ??
303+
dedicated ??
304+
env.QUERY_CLICKHOUSE_URL ??
305+
env.CLICKHOUSE_URL
303306
);
304307
readerUrl.searchParams.delete("secure");
305308

0 commit comments

Comments
 (0)