Update GlobalModule.ts

This commit is contained in:
syuilo 2024-09-21 20:40:48 +09:00
parent 69c6fea210
commit d9b6dfe810
1 changed files with 5 additions and 1 deletions

View File

@ -90,7 +90,7 @@ const $redisForReactions: Provider = {
const $meta: Provider = {
provide: DI.meta,
useFactory: async (db: DataSource) => {
return await db.transaction(async transactionalEntityManager => {
const meta = await db.transaction(async transactionalEntityManager => {
// 過去のバグでレコードが複数出来てしまっている可能性があるので新しいIDを優先する
const metas = await transactionalEntityManager.find(MiMeta, {
order: {
@ -117,6 +117,10 @@ const $meta: Provider = {
return saved;
}
});
// TODO: redisに繋いでmeta更新
return meta;
},
inject: [DI.db],
};