perf(import): adjustable concurrency and skip redundant SWF downloads
Raise batch concurrency (furni 3->12, clone 10->12) with a Speed control next to Translate. Skip the SWF download when a .nitro bundle already exists on disk (color variants share the base nitro), and stop flagging that as a failed download.
This commit is contained in:
1 parent
641b6b8cb8
commit
2a708b01b1
5 files changed
+42
-5
No files matched your search
@@ -152,6 +152,7 @@ describe("completion of existing furniture", () => {
|
||||
|
||||
it("imports recycler_kintsugiB with an allocated ID throughout SQL and furnidata", async () => {
|
||||
vi.clearAllMocks();
|
||||
mocks.nitroExists = false;
|
||||
const selections = [[], [{ itemName: "recycler_kintsugi" }]];
|
||||
mocks.select.mockImplementation(() => ({
|
||||
from: () => ({ where: () => ({ limit: async () => selections.shift() }) }),
|
||||
|
||||
@@ -711,7 +711,13 @@ export async function importSingleFurni(params: {
|
||||
iconFailure = detail;
|
||||
warnings.push(`Icon download failed: ${detail}`);
|
||||
}),
|
||||
params.providedNitro || (params.preserveAssets && existsSync(nitroPath))
|
||||
// Skip the SWF download entirely when a .nitro bundle already exists on
|
||||
// disk — this happens for colour variants that share the base classname's
|
||||
// nitro file. The SWF is only used for Nitro conversion (not needed) and
|
||||
// icon extraction (the nitro bundle is used as a fallback for that below).
|
||||
existsSync(/*turbopackIgnore: true*/ nitroPath) ||
|
||||
params.providedNitro ||
|
||||
(params.preserveAssets && existsSync(nitroPath))
|
||||
? Promise.resolve(false)
|
||||
: (preservingExisting || params.preserveAssets) && existsSync(swfPath)
|
||||
? Promise.resolve(true)
|
||||
@@ -766,6 +772,7 @@ export async function importSingleFurni(params: {
|
||||
!swfOk &&
|
||||
!nitroDownloadOk &&
|
||||
!params.providedNitro &&
|
||||
!existsSync(/*turbopackIgnore: true*/ nitroPath) &&
|
||||
!(params.preserveAssets && existsSync(nitroPath))
|
||||
)
|
||||
warnings.push(`SWF download failed: ${swfFailure || "unknown cause"}`);
|
||||
|
||||
@@ -33,7 +33,7 @@ export interface RunSseBatchOptions<T> {
|
||||
*/
|
||||
export function runSseBatch<T>(opts: RunSseBatchOptions<T>): Response {
|
||||
const { items, labelOf, worker, signal, flush } = opts;
|
||||
const concurrency = Math.min(Math.max(opts.concurrency || 3, 1), 10);
|
||||
const concurrency = Math.min(Math.max(opts.concurrency || 3, 1), 12);
|
||||
const encoder = new TextEncoder();
|
||||
const ac = new AbortController();
|
||||
|
||||
|
||||
Reference in new issue
Block a user