Run multiple image download queue in parallel (#1203)

This commit is contained in:
Zoe Roux 2025-12-06 01:51:36 +01:00 committed by GitHub
commit 58603c5180
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 12 additions and 6 deletions

View File

@ -8,7 +8,9 @@ import { comment } from "./utils";
await migrate();
// run image processor task in background
processImages();
for (let i = 0; i < 10; i++) {
processImages();
}
const app = new Elysia()
.use(

View File

@ -1,11 +1,11 @@
FROM golang:1.25 AS build
FROM --platform=$BUILDPLATFORM golang:1.25 AS build
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -o /keibi
RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=$TARGETARCH go build -o /keibi
FROM gcr.io/distroless/base-debian11
WORKDIR /app

View File

@ -1,4 +1,4 @@
FROM oven/bun AS builder
FROM --platform=$BUILDPLATFORM oven/bun AS builder
WORKDIR /app
# https://github.com/oven-sh/bun/issues/24538

View File

@ -28,10 +28,12 @@ export const ImageBackground = ({
const { css, theme } = useYoshiki();
const { apiUrl, authToken } = useToken();
const uri = src ? `${apiUrl}${src[quality ?? "high"]}` : null;
return (
<EImageBackground
recyclingKey={uri}
source={{
uri: src ? `${apiUrl}${src[quality ?? "high"]}` : null,
uri,
// use cookies on web to allow `img` to make the call instead of js
headers:
authToken && Platform.OS !== "web"

View File

@ -37,10 +37,12 @@ export const Image = ({
const { css, theme } = useYoshiki();
const { apiUrl, authToken } = useToken();
const uri = src ? `${apiUrl}${src[quality ?? "high"]}` : null;
return (
<EImage
recyclingKey={uri}
source={{
uri: src ? `${apiUrl}${src[quality ?? "high"]}` : null,
uri,
// use cookies on web to allow `img` to make the call instead of js
headers:
authToken && Platform.OS !== "web"