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
@@ -269,6 +269,8 @@ export function StudioClient({
|
||||
null,
|
||||
);
|
||||
const batchAbortRef = useRef<AbortController | null>(null);
|
||||
// How many items the batch endpoints process in parallel.
|
||||
const [concurrency, setConcurrency] = useState(4);
|
||||
|
||||
// Nitro editor
|
||||
const [editingClassname, setEditingClassname] = useState<string | null>(null);
|
||||
@@ -834,7 +836,7 @@ export function StudioClient({
|
||||
revision: i.revision,
|
||||
category: i.category,
|
||||
})),
|
||||
concurrency: 3,
|
||||
concurrency,
|
||||
translate,
|
||||
langs:
|
||||
translate && translateLangs.length > 0 ? translateLangs : undefined,
|
||||
@@ -979,7 +981,7 @@ export function StudioClient({
|
||||
body: JSON.stringify({
|
||||
sourceId: activeSource,
|
||||
classnames: failed,
|
||||
concurrency: 10,
|
||||
concurrency,
|
||||
final: true,
|
||||
}),
|
||||
signal: abort.signal,
|
||||
@@ -1561,6 +1563,33 @@ export function StudioClient({
|
||||
</summary>
|
||||
<div className="flex max-h-48 flex-wrap items-center gap-3 overflow-auto py-3">
|
||||
{" "}
|
||||
{/* ── Import speed (parallel items per batch) ─────────── */}
|
||||
<div className="flex items-center gap-2">
|
||||
<span className="text-xs font-medium text-[var(--admin-text-muted)]">
|
||||
Speed
|
||||
</span>
|
||||
<Select
|
||||
value={String(concurrency)}
|
||||
onValueChange={(value) =>
|
||||
setConcurrency(Math.max(1, Number(value)))
|
||||
}
|
||||
>
|
||||
<SelectTrigger
|
||||
aria-label="Import speed"
|
||||
className="h-8 w-24 text-xs"
|
||||
>
|
||||
<SelectValue>{`${concurrency} parallel`}</SelectValue>
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="1">1 (gentle)</SelectItem>
|
||||
<SelectItem value="2">2</SelectItem>
|
||||
<SelectItem value="4">4 (recommended)</SelectItem>
|
||||
<SelectItem value="6">6</SelectItem>
|
||||
<SelectItem value="8">8</SelectItem>
|
||||
<SelectItem value="12">12 (turbo)</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
{/* ── Translate control (per-import) ─────────────── */}
|
||||
<div className="flex items-center gap-2">
|
||||
<div className="flex h-8 items-center gap-1.5 rounded-md border border-[var(--admin-border)] px-2.5">
|
||||
|
||||
Reference in new issue
Block a user