perf: Remove dynamic imports of Sentry (#20545)
This commit is contained in:
1 parent
ddde762f9b
commit
3d583678cf
6 files changed
+10
-11
No files matched your search
@@ -1,3 +1,5 @@
|
||||
import { captureException } from "@sentry/nextjs";
|
||||
|
||||
import db from "@calcom/prisma";
|
||||
|
||||
import type { AppFlags } from "./config";
|
||||
@@ -9,7 +11,6 @@ export class FeaturesRepository implements IFeaturesRepository {
|
||||
try {
|
||||
return await getFeatureFlag(db, slug);
|
||||
} catch (err) {
|
||||
const captureException = (await import("@sentry/nextjs")).captureException;
|
||||
captureException(err);
|
||||
throw err;
|
||||
}
|
||||
@@ -34,7 +35,6 @@ 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,7 +61,6 @@ export class FeaturesRepository implements IFeaturesRepository {
|
||||
if (user) return true;
|
||||
return false;
|
||||
} catch (err) {
|
||||
const captureException = (await import("@sentry/nextjs")).captureException;
|
||||
captureException(err);
|
||||
throw err;
|
||||
}
|
||||
@@ -73,7 +72,6 @@ export class FeaturesRepository implements IFeaturesRepository {
|
||||
});
|
||||
return !!teamFeature;
|
||||
} catch (err) {
|
||||
const captureException = (await import("@sentry/nextjs")).captureException;
|
||||
captureException(err);
|
||||
throw err;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { captureException } from "@sentry/nextjs";
|
||||
|
||||
import db from "@calcom/prisma";
|
||||
|
||||
import type { IUsersRepository } from "./users.repository.interface";
|
||||
@@ -11,7 +13,6 @@ export class UsersRepository implements IUsersRepository {
|
||||
});
|
||||
return user;
|
||||
} catch (err) {
|
||||
const captureException = (await import("@sentry/nextjs")).captureException;
|
||||
captureException(err);
|
||||
throw err;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { captureException } from "@sentry/nextjs";
|
||||
|
||||
import db from "@calcom/prisma";
|
||||
import { WatchlistType, WatchlistSeverity } from "@calcom/prisma/enums";
|
||||
|
||||
@@ -18,7 +20,6 @@ export class WatchlistRepository implements IWatchlistRepository {
|
||||
});
|
||||
return emailInWatchlist;
|
||||
} catch (err) {
|
||||
const captureException = (await import("@sentry/nextjs")).captureException;
|
||||
captureException(err);
|
||||
throw err;
|
||||
}
|
||||
@@ -34,7 +35,6 @@ export class WatchlistRepository implements IWatchlistRepository {
|
||||
});
|
||||
return domainInWatchWatchlist;
|
||||
} catch (err) {
|
||||
const captureException = (await import("@sentry/nextjs")).captureException;
|
||||
captureException(err);
|
||||
throw err;
|
||||
}
|
||||
@@ -90,7 +90,6 @@ export class WatchlistRepository implements IWatchlistRepository {
|
||||
});
|
||||
return blockedRecords;
|
||||
} catch (err) {
|
||||
const captureException = (await import("@sentry/nextjs")).captureException;
|
||||
captureException(err);
|
||||
throw err;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user