Skip to content

Commit 930a5fa

Browse files
committed
add missing exports and fix sonar suggestions
1 parent e7c499e commit 930a5fa

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

packages/modules/couchbase/src/bucket-definition.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export class BucketDefinition {
44
private quota = 100;
55
private numOfReplicas = 0;
66

7-
constructor(private name: string) {}
7+
constructor(private readonly name: string) {}
88

99
withReplicas(numOfReplicas: number) {
1010
const minThreshold = 0;

packages/modules/couchbase/src/couchbase-container.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export class CouchbaseContainer extends GenericContainer {
6060

6161
withServiceQuota(service: CouchbaseService, quotaMb: number) {
6262
if (!service.hasQuota()) {
63-
throw new Error(`The provided service (${service}) has no quota to configure`);
63+
throw new Error(`The provided service (${service.getIdentifier()}) has no quota to configure`);
6464
}
6565

6666
if (quotaMb < service.getMinimumQuotaMb()) {
@@ -253,14 +253,14 @@ export class CouchbaseContainer extends GenericContainer {
253253
}
254254

255255
private async setMemoryQuotas(container: StartedTestContainer) {
256-
log.debug(`Custom service memory quotas: ${this.customServiceQuotas}`);
257256
for (const service of this.enabledServices) {
258257
if (!service.hasQuota()) {
259258
continue;
260259
}
261260

262261
const body = new URLSearchParams();
263-
const quota = this.customServiceQuotas.get(service) || service.getMinimumQuotaMb();
262+
const quota = this.customServiceQuotas.get(service) ?? service.getMinimumQuotaMb();
263+
log.debug(`Custom service memory quotas: ${service.getIdentifier()} - ${quota} Mb.`);
264264

265265
if (service.getIdentifier() === CouchbaseService.KV.getIdentifier()) {
266266
body.set("memoryQuota", quota.toString());

packages/modules/couchbase/src/couchbase-service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export class CouchbaseService {
22
constructor(
3-
private identifier: string,
4-
private minimumQuotaMb: number
3+
private readonly identifier: string,
4+
private readonly minimumQuotaMb: number
55
) {}
66

77
static readonly KV = new CouchbaseService("kv", 256);
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1+
export { BucketDefinition } from "./bucket-definition";
12
export { CouchbaseContainer, StartedCouchbaseContainer } from "./couchbase-container";
3+
export { CouchbaseService } from "./couchbase-service";

0 commit comments

Comments
 (0)