make the number of connections configurable

This commit is contained in:
Namekuji 2023-09-26 18:53:47 -04:00
parent 41e910b57e
commit 3c1a727b6a
No known key found for this signature in database
GPG key ID: 1D62332C07FBA532
3 changed files with 14 additions and 5 deletions

View file

@ -77,18 +77,23 @@ db:
# # appear in their home timeline.
# #
# # (default 14)
# sparseTimelineDays: 14
# #sparseTimelineDays: 14
#
# # <queryLimit> determines the number of maximum rows read within one pagination.
# # You may need to make [max_clustering_key_restrictions_per_query] larger for ScyllaDB
# # if you want to set this value larger than 100.
# # (default 100, max 5000, min 1)
# queryLimit: 100
# #queryLimit: 100
#
# # Credentials for authentication (leave blank if not needed)
# #credentials:
# # username: username
# # password: password
#
# # Number of pooled connections per host
# #connections:
# # local: 2
# # remote: 1
# ┌─────────────────────┐

View file

@ -27,7 +27,11 @@ export type Source = {
credentials?: {
username: string;
password: string;
}
};
connections?: {
local: number;
remote: number;
};
};
redis: {
host: string;

View file

@ -29,8 +29,8 @@ function newClient(): Client | null {
keyspace: config.scylla.keyspace,
pooling: {
coreConnectionsPerHost: {
[types.distance.local]: 2,
[types.distance.remote]: 1,
[types.distance.local]: config.scylla.connections?.local || 2,
[types.distance.remote]: config.scylla.connections?.remote || 1,
},
},
requestTracker,