Commit 7b26e1fb authored by nanahira's avatar nanahira

use lock

parent d6b25514
Pipeline #20030 passed with stages
in 1 minute and 15 seconds
...@@ -27,6 +27,7 @@ export class AppService extends ConsoleLogger { ...@@ -27,6 +27,7 @@ export class AppService extends ConsoleLogger {
const url = req.originalUrl.startsWith('/') const url = req.originalUrl.startsWith('/')
? req.originalUrl.slice(1) ? req.originalUrl.slice(1)
: req.originalUrl; : req.originalUrl;
return this.aragami.lock(url, async () => {
const siteCache = await this.aragami.get(SiteCache, url); const siteCache = await this.aragami.get(SiteCache, url);
if (siteCache) { if (siteCache) {
this.log(`Cache hit for ${url}`); this.log(`Cache hit for ${url}`);
...@@ -44,5 +45,6 @@ export class AppService extends ConsoleLogger { ...@@ -44,5 +45,6 @@ export class AppService extends ConsoleLogger {
`Page not found: ${url}`, `Page not found: ${url}`,
).toException(); ).toException();
} }
});
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment