perf(studio): cache furni imports and virtualize the furniture grid
- Add TTL-based caching for local index lookup, furnidata classnames, catalog id set, nitro file presence and import stats - Invalidate caches after furnace single/batch/clone imports - Rewrite batch progress with elapsed time, rate and verification chips - Virtualize the grid with @tanstack/react-virtual and replace the Load more button with infinite scroll via an IntersectionObserver
This commit is contained in:
1 parent
2920669362
commit
d02aaa0d87
6 files changed
+672
-345
No files matched your search
@@ -21,6 +21,7 @@ import {
|
||||
syncAssetsToGamedataBundle,
|
||||
verifyAndFixInteractionModesCount,
|
||||
} from "@/lib/services/furni-import";
|
||||
import { clearFurniImportCache } from "@/lib/services/furni-import-cache";
|
||||
import { runSseBatch } from "@/lib/services/import/core/sse-batch";
|
||||
import { rcon } from "@/lib/services/rcon";
|
||||
|
||||
@@ -179,6 +180,9 @@ export const POST = withAdmin(
|
||||
} catch {
|
||||
/* best effort — post-import consolidation is non-fatal */
|
||||
}
|
||||
|
||||
// New items + files landed — drop caches so the Studio refresh is fresh.
|
||||
clearFurniImportCache();
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
@@ -19,6 +19,7 @@ import {
|
||||
syncAssetsToGamedataBundle,
|
||||
verifyAndFixInteractionModesCount,
|
||||
} from "@/lib/services/furni-import";
|
||||
import { clearFurniImportCache } from "@/lib/services/furni-import-cache";
|
||||
import { rcon } from "@/lib/services/rcon";
|
||||
import type { ImportSingleResult } from "@/types/furni";
|
||||
|
||||
@@ -195,6 +196,11 @@ export const POST = withAdmin(
|
||||
await new Promise((r) => setImmediate(r));
|
||||
}
|
||||
|
||||
if (succeeded > 0) {
|
||||
// New items + files landed — drop caches so the Studio refresh is fresh.
|
||||
clearFurniImportCache();
|
||||
}
|
||||
|
||||
if (aborted) {
|
||||
send({
|
||||
type: "batch_complete",
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user