chore(server/utils): timeLimit - add TODO comment

This commit is contained in:
Panagiotis Papadopoulos 2025-01-31 07:43:25 +01:00
parent 9a8a27c02c
commit ef66d330ec

View File

@ -9,6 +9,7 @@ import mimeTypes from "mime-types";
import path from "path"; import path from "path";
import { fileURLToPath } from "url"; import { fileURLToPath } from "url";
import { dirname, join } from "path"; import { dirname, join } from "path";
//import type { NoteType } from "../rows.js";
const randtoken = generator({ source: "crypto" }); const randtoken = generator({ source: "crypto" });
@ -203,6 +204,7 @@ export function getNoteTitle(filePath: string, replaceUnderscoresWithSpaces: boo
} }
export function timeLimit<T>(promise: Promise<T>, limitMs: number, errorMessage?: string): Promise<T> { 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) { if (!promise || !promise.then) {
// it's not actually a promise // it's not actually a promise
return promise; return promise;