Files
subwatcher/services/ui/src/hooks/usePoll.ts
wisecolt f1a1f093e6 feat: altyazı otomasyon sistemi MVP'sini ekle
Docker tabanlı mikro servis mimarisi ile altyazı otomasyon sistemi altyapısı kuruldu.

- Core (Node.js): Chokidar dosya izleyici, BullMQ iş kuyrukları, ffprobe medya analizi, MongoDB entegrasyonu ve dosya yazma işlemleri.
- API (Fastify): Mock sağlayıcılar, arşiv güvenliği (zip-slip), altyazı doğrulama, puanlama ve aday seçim motoru.
- UI (React/Vite): İş yönetimi paneli, canlı SSE log akışı, manuel inceleme arayüzü ve sistem ayarları.
- Altyapı: Docker Compose (dev/prod), Redis, Mongo ve çevresel değişken yapılandırmaları.
2026-02-15 23:12:24 +03:00

17 lines
338 B
TypeScript

import { useEffect } from 'react';
export function usePoll(fn: () => void | Promise<void>, ms: number) {
useEffect(() => {
let active = true;
const tick = async () => {
if (!active) return;
await fn();
setTimeout(tick, ms);
};
tick();
return () => {
active = false;
};
}, [fn, ms]);
}