Skip to content

Commit

Permalink
chore(server/utils): timeLimit - add TODO comment
Browse files Browse the repository at this point in the history
  • Loading branch information
pano9000 committed Jan 31, 2025
1 parent 697bda1 commit 85d641d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/services/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import mimeTypes from "mime-types";
import path from "path";
import { fileURLToPath } from "url";
import { dirname, join } from "path";
//import type { NoteType } from "../rows.js";

const randtoken = generator({ source: "crypto" });

Expand Down Expand Up @@ -203,6 +204,7 @@ export function getNoteTitle(filePath: string, replaceUnderscoresWithSpaces: boo
}

export function timeLimit<T>(promise: Promise<T>, limitMs: number, errorMessage?: string): Promise<T> {
// TriliumNextTODO: since TS avoids this from ever happening – do we need this check?
if (!promise || !promise.then) {
// it's not actually a promise
return promise;
Expand Down

0 comments on commit 85d641d

Please sign in to comment.