Add Sentry, fix compile errors

This commit is contained in:
The Arcane Brony committed 2021-12-22 18:43:39 +01:00
1 parent a12c372f04
commit a9a92ff2cb
9 files changed
+56 -10

No files matched your search

+2 -2
View File
@@ -52,12 +52,12 @@ export class BaseClassWithoutId extends BaseEntity {
static increment<T extends BaseClass>(conditions: FindConditions<T>, propertyPath: string, value: number | string) {
const repository = this.getRepository();
return repository.increment(conditions, propertyPath, value);
return repository.increment(conditions as T, propertyPath, value);
}
static decrement<T extends BaseClass>(conditions: FindConditions<T>, propertyPath: string, value: number | string) {
const repository = this.getRepository();
return repository.decrement(conditions, propertyPath, value);
return repository.decrement(conditions as T, propertyPath, value);
}
}
+1 -1
View File
@@ -203,7 +203,7 @@ export class Channel extends BaseClass {
static async createDMChannel(recipients: string[], creator_user_id: string, name?: string) {
recipients = recipients.unique().filter((x) => x !== creator_user_id);
const otherRecipientsUsers = await User.find({ where: recipients.map((x) => ({ id: x })), select: ["id"] });
const otherRecipientsUsers = await User.find({ where: recipients.map((x) => ({ id: x })) });
// TODO: check config for max number of recipients
if (otherRecipientsUsers.length !== recipients.length) {
+10
View File
@@ -188,6 +188,11 @@ export interface ConfigValue {
},
metrics: {
timeout: number;
},
sentry: {
enabled: boolean;
endpoint: string;
traceSampleRate: number;
}
}
@@ -377,5 +382,10 @@ export const DefaultConfigOptions: ConfigValue = {
},
metrics: {
timeout: 30000
},
sentry: {
enabled: false,
endpoint: "",
traceSampleRate: 1.0
}
};