Files
Pien-Studio/apps/web/hooks/use-asset-cleanup-job.ts
T

15 lines
397 B
TypeScript
Raw Normal View History

2026-05-10 03:06:54 +07:00
"use client";
import React from "react";
2026-05-31 03:03:49 +07:00
import { localProjectRepository } from "../lib/project-repository";
2026-05-10 03:06:54 +07:00
export function useAssetCleanupJob() {
React.useEffect(() => {
2026-05-31 03:03:49 +07:00
if (typeof window === "undefined") return undefined;
const id = window.setInterval(() => {
void localProjectRepository.cleanupAssets();
}, 45_000);
return () => window.clearInterval(id);
2026-05-10 03:06:54 +07:00
}, []);
}