enhance(backend): improve cache
This commit is contained in:
parent
625fed8838
commit
f44504097c
32 changed files with 264 additions and 448 deletions
|
@ -9,6 +9,7 @@ import { NoteReadService } from '@/core/NoteReadService.js';
|
|||
import { GlobalEventService } from '@/core/GlobalEventService.js';
|
||||
import { NotificationService } from '@/core/NotificationService.js';
|
||||
import { bindThis } from '@/decorators.js';
|
||||
import { CacheService } from '@/core/CacheService.js';
|
||||
import { AuthenticateService } from './AuthenticateService.js';
|
||||
import MainStreamConnection from './stream/index.js';
|
||||
import { ChannelsService } from './stream/ChannelsService.js';
|
||||
|
@ -45,7 +46,7 @@ export class StreamingApiServerService {
|
|||
@Inject(DI.userProfilesRepository)
|
||||
private userProfilesRepository: UserProfilesRepository,
|
||||
|
||||
private globalEventService: GlobalEventService,
|
||||
private cacheService: CacheService,
|
||||
private noteReadService: NoteReadService,
|
||||
private authenticateService: AuthenticateService,
|
||||
private channelsService: ChannelsService,
|
||||
|
@ -73,8 +74,6 @@ export class StreamingApiServerService {
|
|||
return;
|
||||
}
|
||||
|
||||
const connection = request.accept();
|
||||
|
||||
const ev = new EventEmitter();
|
||||
|
||||
async function onRedisMessage(_: string, data: string): Promise<void> {
|
||||
|
@ -85,19 +84,19 @@ export class StreamingApiServerService {
|
|||
this.redisSubscriber.on('message', onRedisMessage);
|
||||
|
||||
const main = new MainStreamConnection(
|
||||
this.followingsRepository,
|
||||
this.mutingsRepository,
|
||||
this.renoteMutingsRepository,
|
||||
this.blockingsRepository,
|
||||
this.channelFollowingsRepository,
|
||||
this.userProfilesRepository,
|
||||
this.channelsService,
|
||||
this.globalEventService,
|
||||
this.noteReadService,
|
||||
this.notificationService,
|
||||
connection, ev, user, miapp,
|
||||
this.cacheService,
|
||||
ev, user, miapp,
|
||||
);
|
||||
|
||||
await main.init();
|
||||
|
||||
const connection = request.accept();
|
||||
|
||||
main.init2(connection);
|
||||
|
||||
const intervalId = user ? setInterval(() => {
|
||||
this.usersRepository.update(user.id, {
|
||||
lastActiveDate: new Date(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue