Skip to content
Snippets Groups Projects
Commit 7a6f2c4c authored by Max Frederiksen's avatar Max Frederiksen
Browse files

Merge branch 'CE-3454-polling-interval-loading-indicators' into 'develop'

CE-3454: DEFAULT_POLLING_INTERVAL_MILLIS

See merge request !600
parents 5c2998fa 8e6c6158
No related branches found
No related tags found
2 merge requests!612Release 5.0.0,!600CE-3454: DEFAULT_POLLING_INTERVAL_MILLIS
Pipeline #213776 passed
......@@ -3,7 +3,10 @@ import { Stack, Typography } from "@mui/material";
import { usePagination } from "@ess-ics/ce-ui-common";
import { useListJobsQuery, IocDetails } from "../../../store/deployApi";
import { initRequestParams } from "../../../api/initRequestParams";
import { ROWS_PER_PAGE } from "../../../constants";
import {
DEFAULT_POLLING_INTERVAL_MILLIS,
ROWS_PER_PAGE
} from "../../../constants";
import { JobTable } from "../../Job";
interface JobSectionProps {
......@@ -22,7 +25,7 @@ export const JobSection = ({ ioc }: JobSectionProps) => {
...initRequestParams({ pagination }),
iocId: ioc.id
},
{ pollingInterval: 5000 }
{ pollingInterval: DEFAULT_POLLING_INTERVAL_MILLIS }
);
useEffect(() => {
......
......@@ -22,6 +22,7 @@ import { LogStreamConsoleDialog } from "../LogStream/LogStreamConsoleDialog";
import { TimeRange } from "../Inputs/TimeRange";
import { PopoutButton } from "../Buttons/PopoutButton";
import { useCustomSnackbar } from "../snackbar/Snackbar";
import { DEFAULT_POLLING_INTERVAL_MILLIS } from "../../../constants";
const TIME_RANGE_VALUES = [
{
......@@ -40,8 +41,6 @@ const TIME_RANGE_VALUES = [
* isSyslog: boolean, if true -> SysLog will be queried, if false -> procServLog will be queried
*/
const LOG_POLL_INTERVAL = 5000;
interface LokiPanelProps {
hostName?: string;
iocName?: string;
......@@ -83,14 +82,14 @@ export function LokiPanel({
getSysLogData,
{ data: sysLogData, error: sysLogError, isLoading: sysDataIsLoading }
] = useLazyFetchSyslogLinesQuery({
pollingInterval: isExpanded ? LOG_POLL_INTERVAL : 0
pollingInterval: isExpanded ? DEFAULT_POLLING_INTERVAL_MILLIS : 0
});
const [
getProcServLog,
{ data: procServLog, error: procServLogError, isLoading: procDataIsLoading }
] = useLazyFetchProcServLogLinesQuery({
pollingInterval: isExpanded ? LOG_POLL_INTERVAL : 0
pollingInterval: isExpanded ? DEFAULT_POLLING_INTERVAL_MILLIS : 0
});
const preprocessLog = useCallback(
......
......@@ -8,8 +8,7 @@ import {
JobDetails,
useLazyFetchDeploymentJobLogQuery
} from "../../store/deployApi";
const LOG_POLL_INTERVAL = 5000;
import { DEFAULT_POLLING_INTERVAL_MILLIS } from "../../constants";
interface DeploymentJobOutputProps {
job: JobDetails;
......@@ -23,7 +22,7 @@ export function DeploymentJobOutput({
const finalResultsNeeded = useRef(true);
const [getLogById, { data: log, isSuccess: logDataReady, error: logError }] =
useLazyFetchDeploymentJobLogQuery({
pollingInterval: isExpanded ? LOG_POLL_INTERVAL : 0
pollingInterval: isExpanded ? DEFAULT_POLLING_INTERVAL_MILLIS : 0
});
useEffect(() => {
......
......@@ -7,8 +7,7 @@ import { useGetIocQuery } from "../../store/enhancedApi";
import { ApiAlertError } from "../../components/common/Alerts/ApiAlertError";
import { getErrorState } from "../../components/common/Alerts/AlertsData";
import { isNotFound } from "../../components/navigation/NotFoundView/isNotFound";
const IOC_POLL_INTERVAL = 5000;
import { DEFAULT_POLLING_INTERVAL_MILLIS } from "../../constants";
interface IOCDetailsContainerProps {
id?: string;
......@@ -21,7 +20,7 @@ export function IOCDetailsContainer({ id }: IOCDetailsContainerProps) {
error
} = useGetIocQuery(
{ iocId: Number(id) },
{ skip: !id, pollingInterval: IOC_POLL_INTERVAL }
{ skip: !id, pollingInterval: DEFAULT_POLLING_INTERVAL_MILLIS }
);
const { status } = getErrorState(error);
......
......@@ -6,8 +6,8 @@ import { NotFoundView } from "../../components/navigation/NotFoundView/NotFoundV
import { useFetchJobQuery } from "../../store/deployApi";
import { getErrorState } from "../../components/common/Alerts/AlertsData";
import { isNotFound } from "../../components/navigation/NotFoundView/isNotFound";
import { DEFAULT_POLLING_INTERVAL_MILLIS } from "../../constants";
const POLL_DEPLOYMENT_INTERVAL = 5000;
export function JobDetailsContainer({ id }: { id?: string }) {
const [jobFinished, setJobFinished] = useState(false);
......@@ -19,7 +19,7 @@ export function JobDetailsContainer({ id }: { id?: string }) {
{ jobId: Number(id) },
{
skip: !id,
pollingInterval: !jobFinished ? POLL_DEPLOYMENT_INTERVAL : undefined
pollingInterval: !jobFinished ? DEFAULT_POLLING_INTERVAL_MILLIS : 0
}
);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment