diff --git a/packages/backend/src/boot/master.ts b/packages/backend/src/boot/master.ts index 6b1fce48c..4e5327641 100644 --- a/packages/backend/src/boot/master.ts +++ b/packages/backend/src/boot/master.ts @@ -140,7 +140,7 @@ async function connectDb(): Promise { } async function spawnWorkers(clusterLimits: Required): Promise { - const modes = ['web', 'queue']; + const modes = ['web' as const, 'queue' as const]; const cpus = os.cpus().length; for (const mode of modes.filter(mode => clusterLimits[mode] > cpus)) { bootLogger.warn(`configuration warning: cluster limit for ${mode} exceeds number of cores (${cpus})`); diff --git a/packages/backend/src/misc/check-hit-antenna.ts b/packages/backend/src/misc/check-hit-antenna.ts index e563d749e..7091dcd07 100644 --- a/packages/backend/src/misc/check-hit-antenna.ts +++ b/packages/backend/src/misc/check-hit-antenna.ts @@ -22,7 +22,7 @@ export async function checkHitAntenna(antenna: Antenna, note: (Note | Packed<'No if (note.visibility === 'specified') return false; // skip if the antenna creator is blocked by the note author - const blockings = await blockingCache.fetch(noteUser.id); + const blockings = (await blockingCache.fetch(noteUser.id)) ?? []; if (blockings.some(blocking => blocking === antenna.userId)) return false; if (note.visibility === 'followers') { diff --git a/packages/backend/src/misc/fetch-meta.ts b/packages/backend/src/misc/fetch-meta.ts index edd6265a8..ab8c81eef 100644 --- a/packages/backend/src/misc/fetch-meta.ts +++ b/packages/backend/src/misc/fetch-meta.ts @@ -57,5 +57,5 @@ export async function fetchMeta(noCache = false): Promise { await getMeta(); - return cache; + return cache!; } diff --git a/packages/backend/src/models/repositories/drive-file.ts b/packages/backend/src/models/repositories/drive-file.ts index 788949d6d..f75207134 100644 --- a/packages/backend/src/models/repositories/drive-file.ts +++ b/packages/backend/src/models/repositories/drive-file.ts @@ -126,7 +126,7 @@ export const DriveFileRepository = db.getRepository(DriveFile).extend({ const file = typeof src === 'object' ? src : await this.findOneBy({ id: src }); if (file == null) return null; - return await this.pack(file); + return await this.pack(file, opts); }, async packMany(