mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
Merge branch 'sentry-conf' into 'main'
Remove `@/config.ts` import when starting Sentry See merge request soapbox-pub/ditto!695
This commit is contained in:
commit
33f903fb99
4 changed files with 16 additions and 15 deletions
|
|
@ -12,6 +12,7 @@ import { NostrEvent, NostrSigner, NRelay, NUploader } from '@nostrify/nostrify';
|
|||
|
||||
import { cron } from '@/cron.ts';
|
||||
import { startFirehose } from '@/firehose.ts';
|
||||
import { startSentry } from '@/sentry.ts';
|
||||
import { DittoAPIStore } from '@/storages/DittoAPIStore.ts';
|
||||
import { DittoPgStore } from '@/storages/DittoPgStore.ts';
|
||||
import { DittoPool } from '@/storages/DittoPool.ts';
|
||||
|
|
@ -182,6 +183,8 @@ type AppController<P extends string = any> = Handler<AppEnv, P, HonoInput, Respo
|
|||
|
||||
const conf = new DittoConf(Deno.env);
|
||||
|
||||
startSentry(conf);
|
||||
|
||||
const db = new DittoPolyPg(conf.databaseUrl, {
|
||||
poolSize: conf.pg.poolSize,
|
||||
debug: conf.pgliteDebug,
|
||||
|
|
|
|||
|
|
@ -1,15 +1,14 @@
|
|||
import * as Sentry from '@sentry/deno';
|
||||
import { logi } from '@soapbox/logi';
|
||||
|
||||
import { Conf } from '@/config.ts';
|
||||
import type { DittoConf } from '@ditto/conf';
|
||||
|
||||
// Sentry
|
||||
if (Conf.sentryDsn) {
|
||||
/** Start Sentry, if configured. */
|
||||
export function startSentry(conf: DittoConf): void {
|
||||
if (conf.sentryDsn) {
|
||||
logi({ level: 'info', ns: 'ditto.sentry', msg: 'Sentry enabled.', enabled: true });
|
||||
Sentry.init({
|
||||
dsn: Conf.sentryDsn,
|
||||
tracesSampleRate: 1.0,
|
||||
});
|
||||
Sentry.init({ dsn: conf.sentryDsn });
|
||||
} else {
|
||||
logi({ level: 'info', ns: 'ditto.sentry', msg: 'Sentry not configured. Skipping.', enabled: false });
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
import { DittoConf } from '@ditto/conf';
|
||||
import { logi } from '@soapbox/logi';
|
||||
|
||||
import '@/sentry.ts';
|
||||
import '@/nostr-wasm.ts';
|
||||
import app from '@/app.ts';
|
||||
import { Conf } from '@/config.ts';
|
||||
|
||||
const conf = new DittoConf(Deno.env);
|
||||
|
||||
Deno.serve({
|
||||
port: Conf.port,
|
||||
port: conf.port,
|
||||
onListen({ hostname, port }): void {
|
||||
logi({ level: 'info', ns: 'ditto.server', msg: `Listening on http://${hostname}:${port}`, hostname, port });
|
||||
},
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ import * as Comlink from 'comlink';
|
|||
import { VerifiedEvent, verifyEvent } from 'nostr-tools';
|
||||
|
||||
import '@/nostr-wasm.ts';
|
||||
import '@/sentry.ts';
|
||||
|
||||
export const VerifyWorker = {
|
||||
verifyEvent(event: NostrEvent): event is VerifiedEvent {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue