fix(printer): increase timeout to 15s

This commit is contained in:
Amruth Pillai
2023-11-14 16:06:16 +01:00
parent 36b1930c0d
commit 457aed5f46
6 changed files with 28 additions and 34 deletions
+2 -4
View File
@@ -14,7 +14,7 @@ import { Config } from "../config/schema";
import { StorageService } from "../storage/storage.service";
import { UtilsService } from "../utils/utils.service";
const PRINTER_TIMEOUT = 10000; // 10 seconds
const PRINTER_TIMEOUT = 15000; // 15 seconds
@Injectable()
export class PrinterService {
@@ -76,9 +76,7 @@ export class PrinterService {
async printPreview(resume: ResumeDto) {
return this.utils.getCachedOrSet(
`user:${resume.userId}:storage:previews:${resume.id}`,
async () => {
return withTimeout(this.generatePreview(resume), PRINTER_TIMEOUT);
},
async () => withTimeout(this.generatePreview(resume), PRINTER_TIMEOUT),
);
}