Skip to content

Commit

Permalink
fix: relax the criteria for determining online status
Browse files Browse the repository at this point in the history
  • Loading branch information
hamster1963 committed Dec 20, 2024
1 parent 8394248 commit 474ed06
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/serverFetch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export async function GetNezhaData() {
const timestamp = Date.now() / 1000
data.result = nezhaDataFiltered.map(
(element: MakeOptional<NezhaAPI, "ipv4" | "ipv6" | "valid_ip">) => {
const isOnline = timestamp - element.last_active <= 60
const isOnline = timestamp - element.last_active <= 180
element.online_status = isOnline

if (isOnline) {
Expand Down Expand Up @@ -208,7 +208,7 @@ export async function GetServerDetail({ server_id }: { server_id: number }) {

const timestamp = Date.now() / 1000
const detailData = detailDataList.map((element) => {
element.online_status = timestamp - element.last_active <= 60
element.online_status = timestamp - element.last_active <= 180
delete element.ipv4
delete element.ipv6
delete element.valid_ip
Expand Down

0 comments on commit 474ed06

Please sign in to comment.