perf: dynamic import for sentry CaptureException (#19730)
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
import { captureException } from "@sentry/nextjs";
|
||||
|
||||
import db from "@calcom/prisma";
|
||||
|
||||
import type { AppFlags } from "./config";
|
||||
@@ -11,6 +9,7 @@ export class FeaturesRepository implements IFeaturesRepository {
|
||||
try {
|
||||
return await getFeatureFlag(db, slug);
|
||||
} catch (err) {
|
||||
const captureException = (await import("@sentry/nextjs")).captureException;
|
||||
captureException(err);
|
||||
throw err;
|
||||
}
|
||||
@@ -35,6 +34,7 @@ export class FeaturesRepository implements IFeaturesRepository {
|
||||
if (userBelongsToTeamWithFeature) return true;
|
||||
return false;
|
||||
} catch (err) {
|
||||
const captureException = (await import("@sentry/nextjs")).captureException;
|
||||
captureException(err);
|
||||
throw err;
|
||||
}
|
||||
@@ -61,6 +61,7 @@ export class FeaturesRepository implements IFeaturesRepository {
|
||||
if (user) return true;
|
||||
return false;
|
||||
} catch (err) {
|
||||
const captureException = (await import("@sentry/nextjs")).captureException;
|
||||
captureException(err);
|
||||
throw err;
|
||||
}
|
||||
@@ -72,6 +73,7 @@ export class FeaturesRepository implements IFeaturesRepository {
|
||||
});
|
||||
return !!teamFeature;
|
||||
} catch (err) {
|
||||
const captureException = (await import("@sentry/nextjs")).captureException;
|
||||
captureException(err);
|
||||
throw err;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import { captureException } from "@sentry/nextjs";
|
||||
|
||||
import db from "@calcom/prisma";
|
||||
|
||||
import type { IUsersRepository } from "./users.repository.interface";
|
||||
@@ -13,6 +11,7 @@ export class UsersRepository implements IUsersRepository {
|
||||
});
|
||||
return user;
|
||||
} catch (err) {
|
||||
const captureException = (await import("@sentry/nextjs")).captureException;
|
||||
captureException(err);
|
||||
throw err;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import { captureException } from "@sentry/nextjs";
|
||||
|
||||
import db from "@calcom/prisma";
|
||||
import { WatchlistType, WatchlistSeverity } from "@calcom/prisma/enums";
|
||||
|
||||
@@ -20,6 +18,7 @@ export class WatchlistRepository implements IWatchlistRepository {
|
||||
});
|
||||
return emailInWatchlist;
|
||||
} catch (err) {
|
||||
const captureException = (await import("@sentry/nextjs")).captureException;
|
||||
captureException(err);
|
||||
throw err;
|
||||
}
|
||||
@@ -35,6 +34,7 @@ export class WatchlistRepository implements IWatchlistRepository {
|
||||
});
|
||||
return domainInWatchWatchlist;
|
||||
} catch (err) {
|
||||
const captureException = (await import("@sentry/nextjs")).captureException;
|
||||
captureException(err);
|
||||
throw err;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user