Skip to content

Commit

Permalink
fixed refresh issue
Browse files Browse the repository at this point in the history
  • Loading branch information
mfreeman451 committed Feb 27, 2025
1 parent a745e73 commit bd7e398
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { Suspense } from 'react';
import ServiceDashboard from '../../../../components/ServiceDashboard';

export const revalidate = 30;
export const revalidate = 0;

async function fetchServiceData(nodeId, serviceName) {
try {
Expand All @@ -11,11 +11,13 @@ async function fetchServiceData(nodeId, serviceName) {

const nodesResponse = await fetch(`${backendUrl}/api/nodes`, {
headers: { 'X-API-Key': apiKey },
next: { revalidate: 30 },
cache: 'no-store', // Prevent caching on the server
});

if (!nodesResponse.ok) {
throw new Error(`Nodes API request failed: ${nodesResponse.status}`);
}

const nodes = await nodesResponse.json();

const node = nodes.find((n) => n.node_id === nodeId);
Expand Down

0 comments on commit bd7e398

Please sign in to comment.