mirror of
https://github.com/spacebarchat/server.git
synced 2026-10-23 13:03:08 +00:00
Add Sentry, fix compile errors
This commit is contained in:
1 parent
a12c372f04
commit
a9a92ff2cb
9 files changed
+56
-10
No files matched your search
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
}
|
||||
};
|
||||
Reference in new issue
Block a user