summaryrefslogtreecommitdiff
path: root/packages/backend/src/core/CacheService.ts
blob: 9c685974418facb42e6ac96865b4161c5a21f3aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
/*
 * SPDX-FileCopyrightText: syuilo and misskey-project
 * SPDX-License-Identifier: AGPL-3.0-only
 */

import { Inject, Injectable } from '@nestjs/common';
import * as Redis from 'ioredis';
import { In, IsNull } from 'typeorm';
import type { BlockingsRepository, FollowingsRepository, MutingsRepository, RenoteMutingsRepository, MiUserProfile, UserProfilesRepository, UsersRepository, MiNote, MiFollowing } from '@/models/_.js';
import { MemoryKVCache, RedisKVCache } from '@/misc/cache.js';
import { QuantumKVCache } from '@/misc/QuantumKVCache.js';
import type { MiLocalUser, MiUser } from '@/models/User.js';
import { DI } from '@/di-symbols.js';
import { UserEntityService } from '@/core/entities/UserEntityService.js';
import { bindThis } from '@/decorators.js';
import type { InternalEventTypes } from '@/core/GlobalEventService.js';
import { InternalEventService } from '@/core/InternalEventService.js';
import type { OnApplicationShutdown } from '@nestjs/common';

export interface FollowStats {
	localFollowing: number;
	localFollowers: number;
	remoteFollowing: number;
	remoteFollowers: number;
}

export interface CachedTranslation {
	sourceLang: string | undefined;
	text: string | undefined;
}

export interface CachedTranslationEntity {
	l?: string;
	t?: string;
	u?: number;
}

@Injectable()
export class CacheService implements OnApplicationShutdown {
	public userByIdCache: MemoryKVCache<MiUser>;
	public localUserByNativeTokenCache: MemoryKVCache<MiLocalUser | null>;
	public localUserByIdCache: MemoryKVCache<MiLocalUser>;
	public uriPersonCache: MemoryKVCache<MiUser | null>;
	public userProfileCache: QuantumKVCache<MiUserProfile>;
	public userMutingsCache: QuantumKVCache<Set<string>>;
	public userBlockingCache: QuantumKVCache<Set<string>>;
	public userBlockedCache: QuantumKVCache<Set<string>>; // NOTE: 「被」Blockキャッシュ
	public renoteMutingsCache: QuantumKVCache<Set<string>>;
	public userFollowingsCache: QuantumKVCache<Map<string, Omit<MiFollowing, 'isFollowerHibernated'>>>;
	public userFollowersCache: QuantumKVCache<Map<string, Omit<MiFollowing, 'isFollowerHibernated'>>>;
	public hibernatedUserCache: QuantumKVCache<boolean>;
	protected userFollowStatsCache = new MemoryKVCache<FollowStats>(1000 * 60 * 10); // 10 minutes
	protected translationsCache: RedisKVCache<CachedTranslationEntity>;

	constructor(
		@Inject(DI.redis)
		private redisClient: Redis.Redis,

		@Inject(DI.redisForSub)
		private redisForSub: Redis.Redis,

		@Inject(DI.usersRepository)
		private usersRepository: UsersRepository,

		@Inject(DI.userProfilesRepository)
		private userProfilesRepository: UserProfilesRepository,

		@Inject(DI.mutingsRepository)
		private mutingsRepository: MutingsRepository,

		@Inject(DI.blockingsRepository)
		private blockingsRepository: BlockingsRepository,

		@Inject(DI.renoteMutingsRepository)
		private renoteMutingsRepository: RenoteMutingsRepository,

		@Inject(DI.followingsRepository)
		private followingsRepository: FollowingsRepository,

		private userEntityService: UserEntityService,
		private readonly internalEventService: InternalEventService,
	) {
		//this.onMessage = this.onMessage.bind(this);

		this.userByIdCache = new MemoryKVCache<MiUser>(1000 * 60 * 5); // 5m
		this.localUserByNativeTokenCache = new MemoryKVCache<MiLocalUser | null>(1000 * 60 * 5); // 5m
		this.localUserByIdCache = new MemoryKVCache<MiLocalUser>(1000 * 60 * 5); // 5m
		this.uriPersonCache = new MemoryKVCache<MiUser | null>(1000 * 60 * 5); // 5m

		this.userProfileCache = new QuantumKVCache(this.internalEventService, 'userProfile', {
			lifetime: 1000 * 60 * 30, // 30m
			fetcher: (key) => this.userProfilesRepository.findOneByOrFail({ userId: key }),
			bulkFetcher: userIds => this.userProfilesRepository.findBy({ userId: In(userIds) }).then(ps => ps.map(p => [p.userId, p])),
		});

		this.userMutingsCache = new QuantumKVCache<Set<string>>(this.internalEventService, 'userMutings', {
			lifetime: 1000 * 60 * 30, // 30m
			fetcher: (key) => this.mutingsRepository.find({ where: { muterId: key }, select: ['muteeId'] }).then(xs => new Set(xs.map(x => x.muteeId))),
			bulkFetcher: muterIds => this.mutingsRepository
				.createQueryBuilder('muting')
				.select('"muting"."muterId"', 'muterId')
				.addSelect('array_agg("muting"."muteeId")', 'muteeIds')
				.where({ muterId: In(muterIds) })
				.groupBy('muting.muterId')
				.getRawMany<{ muterId: string, muteeIds: string[] }>()
				.then(ms => ms.map(m => [m.muterId, new Set(m.muteeIds)])),
		});

		this.userBlockingCache = new QuantumKVCache<Set<string>>(this.internalEventService, 'userBlocking', {
			lifetime: 1000 * 60 * 30, // 30m
			fetcher: (key) => this.blockingsRepository.find({ where: { blockerId: key }, select: ['blockeeId'] }).then(xs => new Set(xs.map(x => x.blockeeId))),
			bulkFetcher: blockerIds => this.blockingsRepository
				.createQueryBuilder('blocking')
				.select('"blocking"."blockerId"', 'blockerId')
				.addSelect('array_agg("blocking"."blockeeId")', 'blockeeIds')
				.where({ blockerId: In(blockerIds) })
				.groupBy('blocking.blockerId')
				.getRawMany<{ blockerId: string, blockeeIds: string[] }>()
				.then(ms => ms.map(m => [m.blockerId, new Set(m.blockeeIds)])),
		});

		this.userBlockedCache = new QuantumKVCache<Set<string>>(this.internalEventService, 'userBlocked', {
			lifetime: 1000 * 60 * 30, // 30m
			fetcher: (key) => this.blockingsRepository.find({ where: { blockeeId: key }, select: ['blockerId'] }).then(xs => new Set(xs.map(x => x.blockerId))),
			bulkFetcher: blockeeIds => this.blockingsRepository
				.createQueryBuilder('blocking')
				.select('"blocking"."blockeeId"', 'blockeeId')
				.addSelect('array_agg("blocking"."blockeeId")', 'blockeeIds')
				.where({ blockeeId: In(blockeeIds) })
				.groupBy('blocking.blockeeId')
				.getRawMany<{ blockeeId: string, blockerIds: string[] }>()
				.then(ms => ms.map(m => [m.blockeeId, new Set(m.blockerIds)])),
		});

		this.renoteMutingsCache = new QuantumKVCache<Set<string>>(this.internalEventService, 'renoteMutings', {
			lifetime: 1000 * 60 * 30, // 30m
			fetcher: (key) => this.renoteMutingsRepository.find({ where: { muterId: key }, select: ['muteeId'] }).then(xs => new Set(xs.map(x => x.muteeId))),
			bulkFetcher: muterIds => this.renoteMutingsRepository
				.createQueryBuilder('muting')
				.select('"muting"."muterId"', 'muterId')
				.addSelect('array_agg("muting"."muteeId")', 'muteeIds')
				.where({ muterId: In(muterIds) })
				.groupBy('muting.muterId')
				.getRawMany<{ muterId: string, muteeIds: string[] }>()
				.then(ms => ms.map(m => [m.muterId, new Set(m.muteeIds)])),
		});

		this.userFollowingsCache = new QuantumKVCache<Map<string, Omit<MiFollowing, 'isFollowerHibernated'>>>(this.internalEventService, 'userFollowings', {
			lifetime: 1000 * 60 * 30, // 30m
			fetcher: (key) => this.followingsRepository.findBy({ followerId: key }).then(xs => new Map(xs.map(f => [f.followeeId, f]))),
			bulkFetcher: followerIds => this.followingsRepository
				.findBy({ followerId: In(followerIds) })
				.then(fs => fs
					.reduce((groups, f) => {
						let group = groups.get(f.followerId);
						if (!group) {
							group = new Map();
							groups.set(f.followerId, group);
						}
						group.set(f.followeeId, f);
						return groups;
					}, {} as Map<string, Map<string, Omit<MiFollowing, 'isFollowerHibernated'>>>)),
		});

		this.userFollowersCache = new QuantumKVCache<Map<string, Omit<MiFollowing, 'isFollowerHibernated'>>>(this.internalEventService, 'userFollowers', {
			lifetime: 1000 * 60 * 30, // 30m
			fetcher: followeeId => this.followingsRepository.findBy({ followeeId: followeeId }).then(xs => new Map(xs.map(x => [x.followerId, x]))),
			bulkFetcher: followeeIds => this.followingsRepository
				.findBy({ followeeId: In(followeeIds) })
				.then(fs => fs
					.reduce((groups, f) => {
						let group = groups.get(f.followeeId);
						if (!group) {
							group = new Map();
							groups.set(f.followeeId, group);
						}
						group.set(f.followerId, f);
						return groups;
					}, {} as Map<string, Map<string, Omit<MiFollowing, 'isFollowerHibernated'>>>)),
		});

		this.hibernatedUserCache = new QuantumKVCache<boolean>(this.internalEventService, 'hibernatedUsers', {
			lifetime: 1000 * 60 * 30, // 30m
			fetcher: async userId => {
				const { isHibernated } = await this.usersRepository.findOneOrFail({
					where: { id: userId },
					select: { isHibernated: true },
				});
				return isHibernated;
			},
			bulkFetcher: async userIds => {
				const results = await this.usersRepository.find({
					where: { id: In(userIds) },
					select: { id: true, isHibernated: true },
				});
				return results.map(({ id, isHibernated }) => [id, isHibernated]);
			},
			onChanged: async userIds => {
				// We only update local copies since each process will get this event, but we can have user objects in multiple different caches.
				// Before doing anything else we must "find" all the objects to update.
				const userObjects = new Map<string, MiUser[]>();
				const toUpdate: string[] = [];
				for (const uid of userIds) {
					const toAdd: MiUser[] = [];

					const localUserById = this.localUserByIdCache.get(uid);
					if (localUserById) toAdd.push(localUserById);

					const userById = this.userByIdCache.get(uid);
					if (userById) toAdd.push(userById);

					if (toAdd.length > 0) {
						toUpdate.push(uid);
						userObjects.set(uid, toAdd);
					}
				}

				// In many cases, we won't have to do anything.
				// Skipping the DB fetch ensures that this remains a single-step synchronous process.
				if (toUpdate.length > 0) {
					const hibernations = await this.usersRepository.find({ where: { id: In(toUpdate) }, select: { id: true, isHibernated: true } });
					for (const { id, isHibernated } of hibernations) {
						const users = userObjects.get(id);
						if (users) {
							for (const u of users) {
								u.isHibernated = isHibernated;
							}
						}
					}
				}
			},
		});

		this.translationsCache = new RedisKVCache<CachedTranslationEntity>(this.redisClient, 'translations', {
			lifetime: 1000 * 60 * 60 * 24 * 7, // 1 week,
			memoryCacheLifetime: 1000 * 60, // 1 minute
		});

		// NOTE: チャンネルのフォロー状況キャッシュはChannelFollowingServiceで行っている

		this.internalEventService.on('userChangeSuspendedState', this.onUserEvent);
		this.internalEventService.on('userChangeDeletedState', this.onUserEvent);
		this.internalEventService.on('remoteUserUpdated', this.onUserEvent);
		this.internalEventService.on('localUserUpdated', this.onUserEvent);
		this.internalEventService.on('userChangeSuspendedState', this.onUserEvent);
		this.internalEventService.on('userTokenRegenerated', this.onTokenEvent);
		this.internalEventService.on('follow', this.onFollowEvent);
		this.internalEventService.on('unfollow', this.onFollowEvent);
	}

	@bindThis
	private async onUserEvent<E extends 'userChangeSuspendedState' | 'userChangeDeletedState' | 'remoteUserUpdated' | 'localUserUpdated'>(body: InternalEventTypes[E], _: E, isLocal: boolean): Promise<void> {
		{
			{
				{
					const user = await this.usersRepository.findOneBy({ id: body.id });
					if (user == null) {
						this.userByIdCache.delete(body.id);
						this.localUserByIdCache.delete(body.id);
						for (const [k, v] of this.uriPersonCache.entries) {
							if (v.value?.id === body.id) {
								this.uriPersonCache.delete(k);
							}
						}
						if (isLocal) {
							await Promise.all([
								this.userProfileCache.delete(body.id),
								this.userMutingsCache.delete(body.id),
								this.userBlockingCache.delete(body.id),
								this.userBlockedCache.delete(body.id),
								this.renoteMutingsCache.delete(body.id),
								this.userFollowingsCache.delete(body.id),
								this.userFollowersCache.delete(body.id),
								this.hibernatedUserCache.delete(body.id),
							]);
						}
					} else {
						this.userByIdCache.set(user.id, user);
						for (const [k, v] of this.uriPersonCache.entries) {
							if (v.value?.id === user.id) {
								this.uriPersonCache.set(k, user);
							}
						}
						if (this.userEntityService.isLocalUser(user)) {
							this.localUserByNativeTokenCache.set(user.token!, user);
							this.localUserByIdCache.set(user.id, user);
						}
					}
				}
			}
		}
	}

	private async onTokenEvent<E extends 'userTokenRegenerated'>(body: InternalEventTypes[E]): Promise<void> {
		{
			{
				{
					const user = await this.usersRepository.findOneByOrFail({ id: body.id }) as MiLocalUser;
					this.localUserByNativeTokenCache.delete(body.oldToken);
					this.localUserByNativeTokenCache.set(body.newToken, user);
				}
			}
		}
	}

	private async onFollowEvent<E extends 'follow' | 'unfollow'>(body: InternalEventTypes[E], type: E): Promise<void> {
		{
			switch (type) {
				case 'follow': {
					const follower = this.userByIdCache.get(body.followerId);
					if (follower) follower.followingCount++;
					const followee = this.userByIdCache.get(body.followeeId);
					if (followee) followee.followersCount++;
					await Promise.all([
						this.userFollowingsCache.delete(body.followerId),
						this.userFollowersCache.delete(body.followeeId),
					]);
					this.userFollowStatsCache.delete(body.followerId);
					this.userFollowStatsCache.delete(body.followeeId);
					break;
				}
				case 'unfollow': {
					const follower = this.userByIdCache.get(body.followerId);
					if (follower) follower.followingCount--;
					const followee = this.userByIdCache.get(body.followeeId);
					if (followee) followee.followersCount--;
					await Promise.all([
						this.userFollowingsCache.delete(body.followerId),
						this.userFollowersCache.delete(body.followeeId),
					]);
					this.userFollowStatsCache.delete(body.followerId);
					this.userFollowStatsCache.delete(body.followeeId);
					break;
				}
			}
		}
	}

	@bindThis
	public findUserById(userId: MiUser['id']) {
		return this.userByIdCache.fetch(userId, () => this.usersRepository.findOneByOrFail({ id: userId }));
	}

	@bindThis
	public async findLocalUserById(userId: MiUser['id']): Promise<MiLocalUser | null> {
		return await this.localUserByIdCache.fetchMaybe(userId, async () => {
			return await this.usersRepository.findOneBy({ id: userId, host: IsNull() }) as MiLocalUser | null ?? undefined;
		}) ?? null;
	}

	@bindThis
	public async getFollowStats(userId: MiUser['id']): Promise<FollowStats> {
		return await this.userFollowStatsCache.fetch(userId, async () => {
			const stats = {
				localFollowing: 0,
				localFollowers: 0,
				remoteFollowing: 0,
				remoteFollowers: 0,
			};

			const followings = await this.followingsRepository.findBy([
				{ followerId: userId },
				{ followeeId: userId },
			]);

			for (const following of followings) {
				if (following.followerId === userId) {
					// increment following; user is a follower of someone else
					if (following.followeeHost == null) {
						stats.localFollowing++;
					} else {
						stats.remoteFollowing++;
					}
				} else if (following.followeeId === userId) {
					// increment followers; user is followed by someone else
					if (following.followerHost == null) {
						stats.localFollowers++;
					} else {
						stats.remoteFollowers++;
					}
				} else {
					// Should never happen
				}
			}

			// Infer remote-remote followers heuristically, since we don't track that info directly.
			const user = await this.findUserById(userId);
			if (user.host !== null) {
				stats.remoteFollowing = Math.max(0, user.followingCount - stats.localFollowing);
				stats.remoteFollowers = Math.max(0, user.followersCount - stats.localFollowers);
			}

			return stats;
		});
	}

	@bindThis
	public async getCachedTranslation(note: MiNote, targetLang: string): Promise<CachedTranslation | null> {
		const cacheKey = `${note.id}@${targetLang}`;

		// Use cached translation, if present and up-to-date
		const cached = await this.translationsCache.get(cacheKey);
		if (cached && cached.u === note.updatedAt?.valueOf()) {
			return {
				sourceLang: cached.l,
				text: cached.t,
			};
		}

		// No cache entry :(
		return null;
	}

	@bindThis
	public async setCachedTranslation(note: MiNote, targetLang: string, translation: CachedTranslation): Promise<void> {
		const cacheKey = `${note.id}@${targetLang}`;

		await this.translationsCache.set(cacheKey, {
			l: translation.sourceLang,
			t: translation.text,
			u: note.updatedAt?.valueOf(),
		});
	}

	@bindThis
	public async getUsers(userIds: Iterable<string>): Promise<Map<string, MiUser>> {
		const users = new Map<string, MiUser>;

		const toFetch: string[] = [];
		for (const userId of userIds) {
			const fromCache = this.userByIdCache.get(userId);
			if (fromCache) {
				users.set(userId, fromCache);
			} else {
				toFetch.push(userId);
			}
		}

		if (toFetch.length > 0) {
			const fetched = await this.usersRepository.findBy({
				id: In(toFetch),
			});

			for (const user of fetched) {
				users.set(user.id, user);
				this.userByIdCache.set(user.id, user);
			}
		}

		return users;
	}

	@bindThis
	public async isFollowing(follower: string | { id: string }, followee: string | { id: string }): Promise<boolean> {
		const followerId = typeof(follower) === 'string' ? follower : follower.id;
		const followeeId = typeof(followee) === 'string' ? followee : followee.id;

		// This lets us use whichever one is in memory, falling back to DB fetch via userFollowingsCache.
		return this.userFollowersCache.get(followeeId)?.has(followerId)
		?? (await this.userFollowingsCache.fetch(followerId)).has(followeeId);
	}

	/**
	 * Returns all hibernated followers.
	 */
	@bindThis
	public async getHibernatedFollowers(followeeId: string): Promise<MiFollowing[]> {
		const followers = await this.getFollowersWithHibernation(followeeId);
		return followers.filter(f => f.isFollowerHibernated);
	}

	/**
	 * Returns all non-hibernated followers.
	 */
	@bindThis
	public async getNonHibernatedFollowers(followeeId: string): Promise<MiFollowing[]> {
		const followers = await this.getFollowersWithHibernation(followeeId);
		return followers.filter(f => !f.isFollowerHibernated);
	}

	/**
	 * Returns follower relations with populated isFollowerHibernated.
	 * If you don't need this field, then please use userFollowersCache directly for reduced overhead.
	 */
	@bindThis
	public async getFollowersWithHibernation(followeeId: string): Promise<MiFollowing[]> {
		const followers = await this.userFollowersCache.fetch(followeeId);
		const hibernations = await this.hibernatedUserCache.fetchMany(followers.keys()).then(fs => fs.reduce((map, f) => {
			map.set(f[0], f[1]);
			return map;
		}, new Map<string, boolean>));
		return Array.from(followers.values()).map(following => ({
			...following,
			isFollowerHibernated: hibernations.get(following.followerId) ?? false,
		}));
	}

	/**
	 * Refreshes follower and following relations for the given user.
	 */
	@bindThis
	public async refreshFollowRelationsFor(userId: string): Promise<void> {
		const followings = await this.userFollowingsCache.refresh(userId);
		const followees = Array.from(followings.values()).map(f => f.followeeId);
		await this.userFollowersCache.deleteMany(followees);
	}

	@bindThis
	public clear(): void {
		this.userByIdCache.clear();
		this.localUserByNativeTokenCache.clear();
		this.localUserByIdCache.clear();
		this.uriPersonCache.clear();
		this.userProfileCache.clear();
		this.userMutingsCache.clear();
		this.userBlockingCache.clear();
		this.userBlockedCache.clear();
		this.renoteMutingsCache.clear();
		this.userFollowingsCache.clear();
		this.userFollowStatsCache.clear();
		this.translationsCache.clear();
	}

	@bindThis
	public dispose(): void {
		this.internalEventService.off('userChangeSuspendedState', this.onUserEvent);
		this.internalEventService.off('userChangeDeletedState', this.onUserEvent);
		this.internalEventService.off('remoteUserUpdated', this.onUserEvent);
		this.internalEventService.off('localUserUpdated', this.onUserEvent);
		this.internalEventService.off('userChangeSuspendedState', this.onUserEvent);
		this.internalEventService.off('userTokenRegenerated', this.onTokenEvent);
		this.internalEventService.off('follow', this.onFollowEvent);
		this.internalEventService.off('unfollow', this.onFollowEvent);
		this.userByIdCache.dispose();
		this.localUserByNativeTokenCache.dispose();
		this.localUserByIdCache.dispose();
		this.uriPersonCache.dispose();
		this.userProfileCache.dispose();
		this.userMutingsCache.dispose();
		this.userBlockingCache.dispose();
		this.userBlockedCache.dispose();
		this.renoteMutingsCache.dispose();
		this.userFollowingsCache.dispose();
	}

	@bindThis
	public onApplicationShutdown(signal?: string | undefined): void {
		this.dispose();
	}
}