diff --git a/packages/ozone/src/mod-service/index.ts b/packages/ozone/src/mod-service/index.ts index e77466b5c28..412e414af34 100644 --- a/packages/ozone/src/mod-service/index.ts +++ b/packages/ozone/src/mod-service/index.ts @@ -91,12 +91,8 @@ export class ModerationService { ) } - views = new ModerationViews( - this.db, - this.signingKey, - this.backgroundQueue, - this.appviewAgent, - () => this.createAuthHeaders(this.cfg.appview.did), + views = new ModerationViews(this.db, this.signingKey, this.appviewAgent, () => + this.createAuthHeaders(this.cfg.appview.did), ) async getEvent(id: number): Promise { diff --git a/packages/ozone/src/mod-service/views.ts b/packages/ozone/src/mod-service/views.ts index e00facd36e6..3031d5812f4 100644 --- a/packages/ozone/src/mod-service/views.ts +++ b/packages/ozone/src/mod-service/views.ts @@ -27,7 +27,6 @@ import { REASONOTHER } from '../lexicon/types/com/atproto/moderation/defs' import { subjectFromEventRow, subjectFromStatusRow } from './subject' import { formatLabel, signLabel } from './util' import { LabelRow } from '../db/schema/label' -import { BackgroundQueue } from '../background' import { dbLogger } from '../logger' import { httpLogger } from '../logger' @@ -41,7 +40,6 @@ export class ModerationViews { constructor( private db: Database, private signingKey: Keypair, - private backgroundQueue: BackgroundQueue, private appviewAgent: AtpAgent, private appviewAuth: () => Promise, ) {} @@ -427,17 +425,15 @@ export class ModerationViews { return formatted } const signed = await signLabel(formatted, this.signingKey) - this.backgroundQueue.add(async (db) => { - try { - await db.db - .updateTable('label') - .set({ sig: Buffer.from(signed.sig), signingKey }) - .where('id', '=', row.id) - .execute() - } catch (err) { - dbLogger.error({ err, label: row }, 'failed to update resigned label') - } - }) + try { + await this.db.db + .updateTable('label') + .set({ sig: Buffer.from(signed.sig), signingKey }) + .where('id', '=', row.id) + .execute() + } catch (err) { + dbLogger.error({ err, label: row }, 'failed to update resigned label') + } return signed }