forked from FoundKeyGang/FoundKey
fix some type errors
This commit is contained in:
parent
0c8a3cfeec
commit
08af6fda37
4 changed files with 4 additions and 4 deletions
|
@ -140,7 +140,7 @@ async function connectDb(): Promise<void> {
|
|||
}
|
||||
|
||||
async function spawnWorkers(clusterLimits: Required<Config['clusterLimits']>): Promise<void> {
|
||||
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})`);
|
||||
|
|
|
@ -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') {
|
||||
|
|
|
@ -57,5 +57,5 @@ export async function fetchMeta(noCache = false): Promise<Meta> {
|
|||
|
||||
await getMeta();
|
||||
|
||||
return cache;
|
||||
return cache!;
|
||||
}
|
||||
|
|
|
@ -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(
|
||||
|
|
Loading…
Reference in a new issue