mirror of
https://github.com/YuzuZensai/Pien-Studio.git
synced 2026-09-02 14:18:35 +00:00
♻️ refactor!: massive refactor
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
"use client";
|
||||
|
||||
import React from "react";
|
||||
import { startAssetCleanupJob } from "@pien-studio/storage";
|
||||
import { localProjectRepository } from "../lib/project-repository";
|
||||
|
||||
export function useAssetCleanupJob() {
|
||||
React.useEffect(() => {
|
||||
const stop = startAssetCleanupJob();
|
||||
return () => stop();
|
||||
if (typeof window === "undefined") return undefined;
|
||||
const id = window.setInterval(() => {
|
||||
void localProjectRepository.cleanupAssets();
|
||||
}, 45_000);
|
||||
return () => window.clearInterval(id);
|
||||
}, []);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user