From 1ff1cae7093e60d95b19c41e2fec5c7eeee69f83 Mon Sep 17 00:00:00 2001
From: Quaternions <krakow20@gmail.com>
Date: Thu, 3 Apr 2025 15:12:18 -0700
Subject: [PATCH] web: reduce polling interval The operations will usually take
 half a second.

---
 web/src/app/operations/[operationId]/page.tsx | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/web/src/app/operations/[operationId]/page.tsx b/web/src/app/operations/[operationId]/page.tsx
index d712cdd..36f1c8a 100644
--- a/web/src/app/operations/[operationId]/page.tsx
+++ b/web/src/app/operations/[operationId]/page.tsx
@@ -19,12 +19,12 @@ interface Operation {
 export default function OperationStatusPage() {
 	const router = useRouter();
 	const { operationId } = useParams();
-	
+
 	const [loading, setLoading] = useState(true);
 	const [error, setError] = useState<string | null>(null);
 	const [operation, setOperation] = useState<Operation | null>(null);
-	
-	const intervalRef = useRef<NodeJS.Timeout | null>(null);	
+
+	const intervalRef = useRef<NodeJS.Timeout | null>(null);
 
 	useEffect(() => {
 		if (!operationId) return;
@@ -55,7 +55,7 @@ export default function OperationStatusPage() {
 
 		fetchOperation();
 		if (!intervalRef.current) {
-			intervalRef.current = setInterval(fetchOperation, 5000);
+			intervalRef.current = setInterval(fetchOperation, 1000);
 		}
 
 		return () => {
@@ -77,9 +77,9 @@ export default function OperationStatusPage() {
 				return "Unknown";
 		}
 	};
-	
-	const getStatusClass = (status: number) => getStatusText(status).toLowerCase();	
-	
+
+	const getStatusClass = (status: number) => getStatusText(status).toLowerCase();
+
 	return (
 		<Webpage>
 			<main className="operation-status">
@@ -99,7 +99,7 @@ export default function OperationStatusPage() {
 						<Typography>Owner: {operation.Owner}</Typography>
 						<Typography>Date: {new Date(operation.Date * 1000).toLocaleString()}</Typography>
 						<Typography>Path: {operation.Path}</Typography>
-			
+
 						{operation.Status === 1 && (
 							<div className="submission-button">
 							<Button
@@ -119,4 +119,4 @@ export default function OperationStatusPage() {
 			</main>
 		</Webpage>
 	);
-}
\ No newline at end of file
+}