Skip to content

Commit

Permalink
..
Browse files Browse the repository at this point in the history
  • Loading branch information
ggazzo committed Dec 8, 2023
1 parent d732622 commit 655f933
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions apps/meteor/server/models/raw/BaseRaw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ export abstract class BaseRaw<

this.col = this.db.collection(this.collectionName, options?.collection || {});

void this.createIndexes();
void this.createIndexes().catch((e) => {
console.warn(`Some indexes for collection '${this.collectionName}' could not be created:\n\t${e.message}`);
});

this.preventSetUpdatedAt = options?.preventSetUpdatedAt ?? false;
}
Expand All @@ -83,9 +85,7 @@ export abstract class BaseRaw<
}

if (indexes?.length) {
this.col.createIndexes(indexes).catch((e) => {
console.warn(`Some indexes for collection '${this.collectionName}' could not be created:\n\t${e.message}`);
});
return this.col.createIndexes(indexes);
}
}

Expand Down

0 comments on commit 655f933

Please sign in to comment.