mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-10 04:22:27 +10:00
pin browserless/chrome version as latest it too unstable
This commit is contained in:
@ -49,9 +49,8 @@ export const BuilderToolbar = () => {
|
||||
|
||||
return (
|
||||
<motion.div
|
||||
initial={{ opacity: 0, bottom: -64 }}
|
||||
animate={{ opacity: 0.3, bottom: -28 }}
|
||||
whileHover={{ opacity: 1, bottom: 0 }}
|
||||
initial={{ opacity: 0.5 }}
|
||||
whileHover={{ opacity: 1 }}
|
||||
className="fixed inset-x-0 mx-auto hidden pb-4 pt-6 text-center md:block"
|
||||
>
|
||||
<div className="inline-flex items-center justify-center rounded-full bg-background px-4 shadow-xl">
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import "@/client/libs/dayjs";
|
||||
|
||||
import { i18n } from "@lingui/core";
|
||||
import { detect, fromNavigator, fromStorage, fromUrl } from "@lingui/detect-locale";
|
||||
import { detect, fromStorage, fromUrl } from "@lingui/detect-locale";
|
||||
import { I18nProvider } from "@lingui/react";
|
||||
import { useEffect } from "react";
|
||||
|
||||
@ -20,7 +20,6 @@ export const LocaleProvider = ({ children }: Props) => {
|
||||
const detectedLocale = detect(
|
||||
fromUrl("locale"),
|
||||
fromStorage("locale"),
|
||||
fromNavigator(),
|
||||
userLocale,
|
||||
defaultLocale,
|
||||
)!;
|
||||
|
||||
@ -13,7 +13,6 @@ export const configSchema = z.object({
|
||||
// URLs
|
||||
PUBLIC_URL: z.string().url(),
|
||||
STORAGE_URL: z.string().url(),
|
||||
CHROME_URL: z.string().url(),
|
||||
|
||||
// Database (Prisma)
|
||||
DATABASE_URL: z.string().url().startsWith("postgresql://"),
|
||||
@ -24,6 +23,7 @@ export const configSchema = z.object({
|
||||
|
||||
// Browser
|
||||
CHROME_TOKEN: z.string(),
|
||||
CHROME_URL: z.string().url(),
|
||||
|
||||
// Mail Server
|
||||
SMTP_URL: z.string().url().startsWith("smtp://").optional(),
|
||||
|
||||
@ -14,13 +14,13 @@ import { Config } from "../config/schema";
|
||||
import { StorageService } from "../storage/storage.service";
|
||||
import { UtilsService } from "../utils/utils.service";
|
||||
|
||||
const PRINTER_TIMEOUT = 15000; // 15 seconds
|
||||
const PRINTER_TIMEOUT = 10000; // 10 seconds
|
||||
|
||||
@Injectable()
|
||||
export class PrinterService {
|
||||
private readonly logger = new Logger(PrinterService.name);
|
||||
|
||||
private browserEndpoint: string;
|
||||
private browserURL: string;
|
||||
|
||||
constructor(
|
||||
private readonly configService: ConfigService<Config>,
|
||||
@ -31,12 +31,12 @@ export class PrinterService {
|
||||
const chromeUrl = this.configService.getOrThrow<string>("CHROME_URL");
|
||||
const chromeToken = this.configService.getOrThrow<string>("CHROME_TOKEN");
|
||||
|
||||
this.browserEndpoint = `${chromeUrl}?token=${chromeToken}`;
|
||||
this.browserURL = `${chromeUrl}?token=${chromeToken}`;
|
||||
}
|
||||
|
||||
private getBrowser() {
|
||||
try {
|
||||
return connect({ browserWSEndpoint: this.browserEndpoint });
|
||||
return connect({ browserWSEndpoint: this.browserURL });
|
||||
} catch (error) {
|
||||
throw new InternalServerErrorException(ErrorMessage.InvalidBrowserConnection, error.message);
|
||||
}
|
||||
@ -56,10 +56,10 @@ export class PrinterService {
|
||||
const start = performance.now();
|
||||
|
||||
const url = await retry(() => withTimeout(this.generateResume(resume), PRINTER_TIMEOUT), {
|
||||
retries: 3,
|
||||
retries: 2,
|
||||
randomize: true,
|
||||
onRetry: (_, attempt) => {
|
||||
this.logger.debug(`Retrying resume print job: Attempt #${attempt}`);
|
||||
this.logger.debug(`Print Resume: retry attempt #${attempt}`);
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
2
package-lock.json
generated
2
package-lock.json
generated
@ -104,7 +104,7 @@
|
||||
"passport-jwt": "^4.0.1",
|
||||
"passport-local": "^1.0.0",
|
||||
"pdf-lib": "^1.17.1",
|
||||
"puppeteer": "^21.5.1",
|
||||
"puppeteer": "^21.4.1",
|
||||
"qrcode.react": "^3.1.0",
|
||||
"react": "18.2.0",
|
||||
"react-colorful": "^5.6.1",
|
||||
|
||||
@ -209,7 +209,7 @@
|
||||
"passport-jwt": "^4.0.1",
|
||||
"passport-local": "^1.0.0",
|
||||
"pdf-lib": "^1.17.1",
|
||||
"puppeteer": "^21.5.1",
|
||||
"puppeteer": "^21.4.1",
|
||||
"qrcode.react": "^3.1.0",
|
||||
"react": "18.2.0",
|
||||
"react-colorful": "^5.6.1",
|
||||
|
||||
@ -41,7 +41,7 @@ services:
|
||||
|
||||
# Chrome Browser (for printing and previews)
|
||||
chrome:
|
||||
image: browserless/chrome
|
||||
image: browserless/chrome:1.61.0-puppeteer-21.4.1
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- ${CHROME_PORT:-8080}:3000
|
||||
|
||||
@ -36,7 +36,7 @@ services:
|
||||
|
||||
# Chrome Browser (for printing and previews)
|
||||
chrome:
|
||||
image: browserless/chrome
|
||||
image: browserless/chrome:1.61.0-puppeteer-21.4.1
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
TOKEN: chrome_token
|
||||
|
||||
@ -41,7 +41,7 @@ services:
|
||||
|
||||
# Chrome Browser (for printing and previews)
|
||||
chrome:
|
||||
image: browserless/chrome
|
||||
image: browserless/chrome:1.61.0-puppeteer-21.4.1
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
TOKEN: chrome_token
|
||||
|
||||
@ -39,7 +39,7 @@ services:
|
||||
|
||||
# Chrome Browser (for printing and previews)
|
||||
chrome:
|
||||
image: browserless/chrome
|
||||
image: browserless/chrome:1.61.0-puppeteer-21.4.1
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
TOKEN: chrome_token
|
||||
|
||||
Reference in New Issue
Block a user