Compare commits

...

2 Commits

Author SHA1 Message Date
f9a9a37e1a add embed
All checks were successful
Publish Docker Image / docker (push) Successful in 4m2s
2023-12-31 00:00:23 +00:00
0fbea0cb4e update default connection timeout 2023-12-30 23:54:53 +00:00
4 changed files with 13 additions and 10 deletions

View File

@ -2,8 +2,18 @@
<html> <html>
<head> <head>
<link rel="stylesheet" href="../css/main.css" /> <title>Minetrack</title>
<meta charset="UTF-8" />
<!-- Discord Embed -->
<meta content="Minetrack" property="og:title" />
<meta
content="Tracking minecraft servers since 2023"
property="og:description"
/>
<meta content="https://mc.fascinated.cc/" property="og:url" />
<link rel="stylesheet" href="../css/main.css" />
<link <link
rel="stylesheet" rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;700&display=swap" href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;700&display=swap"
@ -11,11 +21,7 @@
<link rel="icon" type="image/svg+xml" href="../images/logo.svg" /> <link rel="icon" type="image/svg+xml" href="../images/logo.svg" />
<meta charset="UTF-8" />
<script defer type="module" src="../js/main.js"></script> <script defer type="module" src="../js/main.js"></script>
<title>Minetrack</title>
</head> </head>
<body> <body>

View File

@ -5,7 +5,7 @@
}, },
"rates": { "rates": {
"pingAll": 15000, "pingAll": 15000,
"connectTimeout": 2500 "connectTimeout": 10000
}, },
"oldPingsCleanup": { "oldPingsCleanup": {
"enabled": false, "enabled": false,

View File

@ -239,7 +239,6 @@ class Database {
// Record not found // Record not found
if (data[0] === undefined) { if (data[0] === undefined) {
// eslint-disable-next-line node/no-callback-literal
callback(false); callback(false);
return; return;
} }
@ -248,7 +247,6 @@ class Database {
const timestamp = data[0].timestamp; const timestamp = data[0].timestamp;
// Allow null player counts and timestamps, the frontend will safely handle them // Allow null player counts and timestamps, the frontend will safely handle them
// eslint-disable-next-line node/no-callback-literal
callback(true, playerCount, timestamp); callback(true, playerCount, timestamp);
} }
); );
@ -272,10 +270,8 @@ class Database {
// Allow null timestamps, the frontend will safely handle them // Allow null timestamps, the frontend will safely handle them
// This allows insertion of free standing records without a known timestamp // This allows insertion of free standing records without a known timestamp
if (playerCount !== null) { if (playerCount !== null) {
// eslint-disable-next-line node/no-callback-literal
callback(true, playerCount, timestamp); callback(true, playerCount, timestamp);
} else { } else {
// eslint-disable-next-line node/no-callback-literal
callback(false); callback(false);
} }
} }

View File

@ -106,6 +106,7 @@ class PingController {
schedule() { schedule() {
setInterval(this.pingAll, config.rates.pingAll); setInterval(this.pingAll, config.rates.pingAll);
// todo: make this a cron job?
this.pingAll(); this.pingAll();
} }