feat: Revamp EPUB import process with batch upload support and enhanced API integration
Build and Push Reader Image / docker (push) Failing after 22s
Build and Push Reader Image / docker (push) Failing after 22s
- Introduced a new batch import client for handling multiple EPUB files simultaneously. - Updated API routes for previewing and importing EPUB files, improving error handling and response management. - Enhanced genre management during import, allowing for dynamic creation and association of genres. - Implemented long-fetch handling to accommodate lengthy processing times for large EPUB files. - Refined UI components for better user experience in the import workflow.
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import { Agent, fetch as undiciFetch } from "undici"
|
||||
|
||||
/** Tránh mặc định undici (headers/body ~300s) cắt kết nối khi API + NAS xử lý lâu. */
|
||||
const longRunningAgent = new Agent({
|
||||
connectTimeout: 120_000,
|
||||
headersTimeout: 3_600_000,
|
||||
bodyTimeout: 3_600_000,
|
||||
})
|
||||
|
||||
export async function readerApiLongFetch(
|
||||
input: string | URL,
|
||||
init?: RequestInit & { duplex?: "half" },
|
||||
): Promise<Response> {
|
||||
const res = await undiciFetch(input, {
|
||||
...init,
|
||||
dispatcher: longRunningAgent,
|
||||
} as Parameters<typeof undiciFetch>[1])
|
||||
return res as unknown as Response
|
||||
}
|
||||
Reference in New Issue
Block a user