Skip to content
This repository has been archived by the owner on Jul 27, 2024. It is now read-only.

Commit

Permalink
fix: skip missing directories
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-0acf4 committed Jun 1, 2024
1 parent b1b94b3 commit 8942887
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion rokahon-server/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { resourcesRouter } from "./routes/resources.ts";
const app = new Application();

app.use(async (ctx, next) => {
logger.info("Req ::", ctx.request.url.href, ctx.request.userAgent.browser);
logger.info("Req ::", ctx.request.url.href);
await next();
});

Expand Down
4 changes: 4 additions & 0 deletions rokahon-server/src/utils/fs_scanner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ export class FsScanner {
async update() {
this.books = [];
for (const dir of this.directories) {
if (!await fs.exists(dir)) {
logger.warn("Cannot resolve root:", dir);
continue;
}
await this.discoverBooks(dir, dir, this.books);
}
this.books.sort((a, b) => comparePath(a.path, b.path));
Expand Down

0 comments on commit 8942887

Please sign in to comment.