summaryrefslogtreecommitdiff
path: root/packages/backend/src/core/MetaService.ts
diff options
context:
space:
mode:
authorokayurisotto <okayurisotto@proton.me>2023-07-08 07:08:16 +0900
committerGitHub <noreply@github.com>2023-07-08 07:08:16 +0900
commitd84796588c1472334ddaf696a817f015c245ce44 (patch)
tree45caa2d8659d35b90bc3f36170e764aa5eb90b70 /packages/backend/src/core/MetaService.ts
parentperf(backend): Improve performance of FetchInstanceMetadata (#11128) (diff)
downloadsharkey-d84796588c1472334ddaf696a817f015c245ce44.tar.gz
sharkey-d84796588c1472334ddaf696a817f015c245ce44.tar.bz2
sharkey-d84796588c1472334ddaf696a817f015c245ce44.zip
cleanup: trim trailing whitespace (#11136)
* cleanup: trim trailing whitespace * update(`.editorconfig`) --------- Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
Diffstat (limited to 'packages/backend/src/core/MetaService.ts')
-rw-r--r--packages/backend/src/core/MetaService.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/packages/backend/src/core/MetaService.ts b/packages/backend/src/core/MetaService.ts
index 5acc9ad9ad..aae0a9134b 100644
--- a/packages/backend/src/core/MetaService.ts
+++ b/packages/backend/src/core/MetaService.ts
@@ -56,7 +56,7 @@ export class MetaService implements OnApplicationShutdown {
@bindThis
public async fetch(noCache = false): Promise<Meta> {
if (!noCache && this.cache) return this.cache;
-
+
return await this.db.transaction(async transactionalEntityManager => {
// 過去のバグでレコードが複数出来てしまっている可能性があるので新しいIDを優先する
const metas = await transactionalEntityManager.find(Meta, {
@@ -64,9 +64,9 @@ export class MetaService implements OnApplicationShutdown {
id: 'DESC',
},
});
-
+
const meta = metas[0];
-
+
if (meta) {
this.cache = meta;
return meta;
@@ -81,7 +81,7 @@ export class MetaService implements OnApplicationShutdown {
['id'],
)
.then((x) => transactionalEntityManager.findOneByOrFail(Meta, x.identifiers[0]));
-
+
this.cache = saved;
return saved;
}