Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/scripts/changed-modules.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ while IFS= read -r file; do
done < <(find "${ROOT_DIR}" -maxdepth 1 -type f -not -name "package.json" -not -name "package-lock.json")

# define an array of modules that won't be part of the build
readonly no_build_modules=("couchbase")
readonly no_build_modules=()

# modules is an array that will store the paths of all the modules in the repository.
modules=()
Expand Down
2 changes: 1 addition & 1 deletion packages/modules/couchbase/src/bucket-definition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export class BucketDefinition {
private quota = 100;
private numOfReplicas = 0;

constructor(private name: string) {}
constructor(private readonly name: string) {}

withReplicas(numOfReplicas: number) {
const minThreshold = 0;
Expand Down
6 changes: 3 additions & 3 deletions packages/modules/couchbase/src/couchbase-container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export class CouchbaseContainer extends GenericContainer {

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

if (quotaMb < service.getMinimumQuotaMb()) {
Expand Down Expand Up @@ -253,14 +253,14 @@ export class CouchbaseContainer extends GenericContainer {
}

private async setMemoryQuotas(container: StartedTestContainer) {
log.debug(`Custom service memory quotas: ${this.customServiceQuotas}`);
for (const service of this.enabledServices) {
if (!service.hasQuota()) {
continue;
}

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

if (service.getIdentifier() === CouchbaseService.KV.getIdentifier()) {
body.set("memoryQuota", quota.toString());
Expand Down
4 changes: 2 additions & 2 deletions packages/modules/couchbase/src/couchbase-service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export class CouchbaseService {
constructor(
private identifier: string,
private minimumQuotaMb: number
private readonly identifier: string,
private readonly minimumQuotaMb: number
) {}

static readonly KV = new CouchbaseService("kv", 256);
Expand Down
2 changes: 2 additions & 0 deletions packages/modules/couchbase/src/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
export { BucketDefinition } from "./bucket-definition";
export { CouchbaseContainer, StartedCouchbaseContainer } from "./couchbase-container";
export { CouchbaseService } from "./couchbase-service";