chore: remove unused file

This commit is contained in:
Mahen 2026-04-04 09:56:33 +07:00
parent 1d0b4e2598
commit 55f634f5fd
1 changed files with 0 additions and 40 deletions

View File

@ -1,40 +0,0 @@
import { Server } from "socket.io";
import type { NextApiRequest, NextApiResponse } from "next";
export default function SocketHandler(req: NextApiRequest, res: any) {
if (res.socket.server.io) {
console.log("Socket sudah berjalan");
} else {
console.log("Socket baru diinisialisasi");
const io = new Server(res.socket.server);
res.socket.server.io = io;
io.on("connection", (socket) => {
console.log("User terhubung:", socket.id);
socket.on("start-analysis", (data) => {
setTimeout(
() =>
socket.emit("progress", {
status: "Scraping data...",
percent: 30,
}),
1000,
);
setTimeout(
() =>
socket.emit("progress", {
status: "Menganalisis dengan XGBoost...",
percent: 70,
}),
3000,
);
setTimeout(
() => socket.emit("analysis-finished", { result: "Selesai" }),
5000,
);
});
});
}
res.end();
}