mirror of
https://github.com/paricafe/misskey.git
synced 2024-12-01 00:36:44 -06:00
parent
b1efc298f7
commit
d8dc10829c
3 changed files with 16 additions and 6 deletions
|
@ -53,6 +53,7 @@
|
||||||
- ファイルアップロード時等にファイル名の拡張子を修正する関数(correctFilename)の挙動を改善
|
- ファイルアップロード時等にファイル名の拡張子を修正する関数(correctFilename)の挙動を改善
|
||||||
- Webhookのペイロードにサーバーのurlが含まれるようになりました
|
- Webhookのペイロードにサーバーのurlが含まれるようになりました
|
||||||
- Webhook設定でsecretを空に出来るように
|
- Webhook設定でsecretを空に出来るように
|
||||||
|
- 使われていないアンテナの自動停止を設定可能に
|
||||||
- Fix: 一部のfeatured noteを照会できない問題を修正
|
- Fix: 一部のfeatured noteを照会できない問題を修正
|
||||||
- Fix: muteがapiからのuser list timeline取得で機能しない問題を修正
|
- Fix: muteがapiからのuser list timeline取得で機能しない問題を修正
|
||||||
- Fix: ジョブキュー管理画面の認証を回避できる問題を修正
|
- Fix: ジョブキュー管理画面の認証を回避できる問題を修正
|
||||||
|
|
|
@ -88,6 +88,7 @@ type Source = {
|
||||||
|
|
||||||
perChannelMaxNoteCacheCount?: number;
|
perChannelMaxNoteCacheCount?: number;
|
||||||
perUserNotificationsMaxCount?: number;
|
perUserNotificationsMaxCount?: number;
|
||||||
|
deactivateAntennaThreshold?: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type Config = {
|
export type Config = {
|
||||||
|
@ -161,6 +162,7 @@ export type Config = {
|
||||||
redisForJobQueue: RedisOptions & RedisOptionsSource;
|
redisForJobQueue: RedisOptions & RedisOptionsSource;
|
||||||
perChannelMaxNoteCacheCount: number;
|
perChannelMaxNoteCacheCount: number;
|
||||||
perUserNotificationsMaxCount: number;
|
perUserNotificationsMaxCount: number;
|
||||||
|
deactivateAntennaThreshold: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
const _filename = fileURLToPath(import.meta.url);
|
const _filename = fileURLToPath(import.meta.url);
|
||||||
|
@ -252,6 +254,7 @@ export function loadConfig(): Config {
|
||||||
clientManifestExists: clientManifestExists,
|
clientManifestExists: clientManifestExists,
|
||||||
perChannelMaxNoteCacheCount: config.perChannelMaxNoteCacheCount ?? 1000,
|
perChannelMaxNoteCacheCount: config.perChannelMaxNoteCacheCount ?? 1000,
|
||||||
perUserNotificationsMaxCount: config.perUserNotificationsMaxCount ?? 300,
|
perUserNotificationsMaxCount: config.perUserNotificationsMaxCount ?? 300,
|
||||||
|
deactivateAntennaThreshold: config.deactivateAntennaThreshold ?? (1000 * 60 * 60 * 24 * 7),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,7 @@ import type { AntennasRepository, MutedNotesRepository, RoleAssignmentsRepositor
|
||||||
import type Logger from '@/logger.js';
|
import type Logger from '@/logger.js';
|
||||||
import { bindThis } from '@/decorators.js';
|
import { bindThis } from '@/decorators.js';
|
||||||
import { IdService } from '@/core/IdService.js';
|
import { IdService } from '@/core/IdService.js';
|
||||||
|
import type { Config } from '@/config.js';
|
||||||
import { QueueLoggerService } from '../QueueLoggerService.js';
|
import { QueueLoggerService } from '../QueueLoggerService.js';
|
||||||
import type * as Bull from 'bullmq';
|
import type * as Bull from 'bullmq';
|
||||||
|
|
||||||
|
@ -18,6 +19,9 @@ export class CleanProcessorService {
|
||||||
private logger: Logger;
|
private logger: Logger;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
|
@Inject(DI.config)
|
||||||
|
private config: Config,
|
||||||
|
|
||||||
@Inject(DI.userIpsRepository)
|
@Inject(DI.userIpsRepository)
|
||||||
private userIpsRepository: UserIpsRepository,
|
private userIpsRepository: UserIpsRepository,
|
||||||
|
|
||||||
|
@ -54,12 +58,14 @@ export class CleanProcessorService {
|
||||||
reason: 'word',
|
reason: 'word',
|
||||||
});
|
});
|
||||||
|
|
||||||
// 7日以上使われてないアンテナを停止
|
// 使われてないアンテナを停止
|
||||||
this.antennasRepository.update({
|
if (this.config.deactivateAntennaThreshold > 0) {
|
||||||
lastUsedAt: LessThan(new Date(Date.now() - (1000 * 60 * 60 * 24 * 7))),
|
this.antennasRepository.update({
|
||||||
}, {
|
lastUsedAt: LessThan(new Date(Date.now() - this.config.deactivateAntennaThreshold)),
|
||||||
isActive: false,
|
}, {
|
||||||
});
|
isActive: false,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
const expiredRoleAssignments = await this.roleAssignmentsRepository.createQueryBuilder('assign')
|
const expiredRoleAssignments = await this.roleAssignmentsRepository.createQueryBuilder('assign')
|
||||||
.where('assign.expiresAt IS NOT NULL')
|
.where('assign.expiresAt IS NOT NULL')
|
||||||
|
|
Loading…
Reference in a new issue