mirror of
https://github.com/hotomoe/hotomoe
synced 2024-12-03 01:08:15 +09:00
clean up
This commit is contained in:
parent
a5b6e807bb
commit
e4345679dc
@ -48,7 +48,6 @@ export class CustomEmojiService implements OnApplicationShutdown {
|
|||||||
fetcher: () => this.emojisRepository.find({ where: { host: IsNull() } }).then(emojis => new Map(emojis.map(emoji => [emoji.name, emoji]))),
|
fetcher: () => this.emojisRepository.find({ where: { host: IsNull() } }).then(emojis => new Map(emojis.map(emoji => [emoji.name, emoji]))),
|
||||||
toRedisConverter: (value) => JSON.stringify(Array.from(value.values())),
|
toRedisConverter: (value) => JSON.stringify(Array.from(value.values())),
|
||||||
fromRedisConverter: (value) => {
|
fromRedisConverter: (value) => {
|
||||||
if (!Array.isArray(JSON.parse(value))) return undefined; // 古いバージョンの壊れたキャッシュが残っていることがある(そのうち消す)
|
|
||||||
return new Map(JSON.parse(value).map((x: Serialized<MiEmoji>) => [x.name, {
|
return new Map(JSON.parse(value).map((x: Serialized<MiEmoji>) => [x.name, {
|
||||||
...x,
|
...x,
|
||||||
updatedAt: x.updatedAt ? new Date(x.updatedAt) : null,
|
updatedAt: x.updatedAt ? new Date(x.updatedAt) : null,
|
||||||
|
Loading…
Reference in New Issue
Block a user