forked from FoundKeyGang/FoundKey
chore: fix more miscellaneous lints
This commit is contained in:
parent
a231b36d59
commit
ccc8bf0289
5 changed files with 11 additions and 11 deletions
|
@ -78,33 +78,33 @@ import { redisClient } from './redis.js';
|
||||||
const sqlLogger = dbLogger.createSubLogger('sql', 'gray', false);
|
const sqlLogger = dbLogger.createSubLogger('sql', 'gray', false);
|
||||||
|
|
||||||
class MyCustomLogger implements Logger {
|
class MyCustomLogger implements Logger {
|
||||||
private highlight(sql: string) {
|
private highlight(sql: string): string {
|
||||||
return highlight.highlight(sql, {
|
return highlight.highlight(sql, {
|
||||||
language: 'sql', ignoreIllegals: true,
|
language: 'sql', ignoreIllegals: true,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public logQuery(query: string, parameters?: any[]) {
|
public logQuery(query: string): void {
|
||||||
sqlLogger.info(this.highlight(query).substring(0, 100));
|
sqlLogger.info(this.highlight(query).substring(0, 100));
|
||||||
}
|
}
|
||||||
|
|
||||||
public logQueryError(error: string, query: string, parameters?: any[]) {
|
public logQueryError(error: string, query: string): void {
|
||||||
sqlLogger.error(this.highlight(query));
|
sqlLogger.error(this.highlight(query));
|
||||||
}
|
}
|
||||||
|
|
||||||
public logQuerySlow(time: number, query: string, parameters?: any[]) {
|
public logQuerySlow(time: number, query: string): void {
|
||||||
sqlLogger.warn(this.highlight(query));
|
sqlLogger.warn(this.highlight(query));
|
||||||
}
|
}
|
||||||
|
|
||||||
public logSchemaBuild(message: string) {
|
public logSchemaBuild(message: string): void {
|
||||||
sqlLogger.info(message);
|
sqlLogger.info(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
public log(message: string) {
|
public log(message: string): void {
|
||||||
sqlLogger.info(message);
|
sqlLogger.info(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
public logMigration(message: string) {
|
public logMigration(message: string): void {
|
||||||
sqlLogger.info(message);
|
sqlLogger.info(message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,7 @@ export function initialize<T>(name: string, limitPerSec = -1): Bull.Queue<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
// ref. https://github.com/misskey-dev/misskey/pull/7635#issue-971097019
|
// ref. https://github.com/misskey-dev/misskey/pull/7635#issue-971097019
|
||||||
function apBackoff(attemptsMade: number, err: Error) {
|
function apBackoff(attemptsMade: number /*, err: Error */): number {
|
||||||
const baseDelay = MINUTE;
|
const baseDelay = MINUTE;
|
||||||
const maxBackoff = 8 * HOUR;
|
const maxBackoff = 8 * HOUR;
|
||||||
let backoff = (Math.pow(2, attemptsMade) - 1) * baseDelay;
|
let backoff = (Math.pow(2, attemptsMade) - 1) * baseDelay;
|
||||||
|
|
|
@ -9,7 +9,7 @@ import { getApId, IObject, ICreate } from '@/remote/activitypub/type.js';
|
||||||
/**
|
/**
|
||||||
* 投稿作成アクティビティを捌きます
|
* 投稿作成アクティビティを捌きます
|
||||||
*/
|
*/
|
||||||
export default async function(resolver: Resolver, actor: CacheableRemoteUser, note: IObject, silent = false, activity?: ICreate): Promise<string> {
|
export default async function(resolver: Resolver, actor: CacheableRemoteUser, note: IObject, silent = false): Promise<string> {
|
||||||
const uri = getApId(note);
|
const uri = getApId(note);
|
||||||
|
|
||||||
if (typeof note === 'object') {
|
if (typeof note === 'object') {
|
||||||
|
|
|
@ -32,7 +32,7 @@ export default define(meta, paramDef, async (ps, user) => {
|
||||||
token: ps.token,
|
token: ps.token,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (result.affected == 0) {
|
if (result.affected === 0) {
|
||||||
throw new ApiError(meta.errors.noSuchSession);
|
throw new ApiError(meta.errors.noSuchSession);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -37,7 +37,7 @@ export const paramDef = {
|
||||||
|
|
||||||
// eslint-disable-next-line import/no-default-export
|
// eslint-disable-next-line import/no-default-export
|
||||||
export default define(meta, paramDef, async (ps, user) => {
|
export default define(meta, paramDef, async (ps, user) => {
|
||||||
const note = await getNote(ps.noteId, user).catch(err => {
|
await getNote(ps.noteId, user).catch(err => {
|
||||||
if (err.id === '9725d0ce-ba28-4dde-95a7-2cbb2c15de24') throw new ApiError('NO_SUCH_NOTE');
|
if (err.id === '9725d0ce-ba28-4dde-95a7-2cbb2c15de24') throw new ApiError('NO_SUCH_NOTE');
|
||||||
throw err;
|
throw err;
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue