mirror of
https://github.com/Buriburizaem0n/admin-frontend-domain.git
synced 2026-02-05 13:10:08 +00:00
temporary fix for high cpu usage (#3)
This commit is contained in:
@@ -11,7 +11,7 @@ import {
|
||||
import { ModelCron } from "@/types";
|
||||
import { ColumnDef, flexRender, getCoreRowModel, useReactTable } from "@tanstack/react-table";
|
||||
import useSWR from "swr";
|
||||
import { useEffect } from "react";
|
||||
import { useEffect, useMemo } from "react";
|
||||
import { ActionButtonGroup } from "@/components/action-button-group";
|
||||
import { HeaderButtonGroup } from "@/components/header-button-group";
|
||||
import { toast } from "sonner";
|
||||
@@ -177,8 +177,12 @@ export default function CronPage() {
|
||||
},
|
||||
];
|
||||
|
||||
const dataCache = useMemo(() => {
|
||||
return data ?? [];
|
||||
}, [data]);
|
||||
|
||||
const table = useReactTable({
|
||||
data: data ?? [],
|
||||
data: dataCache,
|
||||
columns,
|
||||
getCoreRowModel: getCoreRowModel(),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user