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ı.
This commit is contained in:
16
services/ui/src/hooks/usePoll.ts
Normal file
16
services/ui/src/hooks/usePoll.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
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]);
|
||||
}
|
||||
Reference in New Issue
Block a user