Skip to content

Commit

Permalink
pin browserless/chrome version as latest it too unstable
Browse files Browse the repository at this point in the history
  • Loading branch information
AmruthPillai committed Nov 14, 2023
1 parent 044ef8b commit 72852f9
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 18 deletions.
5 changes: 2 additions & 3 deletions apps/client/src/pages/builder/_components/toolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down
3 changes: 1 addition & 2 deletions apps/client/src/providers/locale.tsx
Original file line number Diff line number Diff line change
@@ -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";

Expand All @@ -20,7 +20,6 @@ export const LocaleProvider = ({ children }: Props) => {
const detectedLocale = detect(
fromUrl("locale"),
fromStorage("locale"),
fromNavigator(),
userLocale,
defaultLocale,
)!;
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/config/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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://"),
Expand All @@ -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(),
Expand Down
12 changes: 6 additions & 6 deletions apps/server/src/printer/printer.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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>,
Expand All @@ -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);
}
Expand All @@ -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}`);
},
});

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion tools/compose/development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tools/compose/simple.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tools/compose/traefik-secure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tools/compose/traefik.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 72852f9

Please sign in to comment.