Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(uptime): use get instead of post #228

Merged
merged 1 commit into from
Apr 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/uptime.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
searchParams.set("ping", "0");
searchParams.set("status", "up");

await got.post(url + "?" + searchParams.toString());
await got.get(url + "?" + searchParams.toString());
}

for (;;) {
Expand All @@ -39,12 +39,12 @@

while (!done) {
// wait
await sleep(1000);

Check warning on line 42 in src/uptime.js

View workflow job for this annotation

GitHub Actions / Check

Unexpected `await` inside a loop

Check warning on line 42 in src/uptime.js

View workflow job for this annotation

GitHub Actions / Check

Unexpected `await` inside a loop
}

// How long do we need to sleep
const now = new Date();
const nextTime = new Date(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate(), now.getUTCHours(), now.getUTCMinutes() + 1, now.getUTCSeconds(), 0);
const nextTime = new Date(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate(), now.getUTCHours(), now.getUTCMinutes() + 1, 0, 0);

// eslint-disable-next-line no-await-in-loop
await sleep(nextTime.getTime() - now.getTime());
Expand Down
Loading