Skip to content

Commit

Permalink
comment fixes
Browse files Browse the repository at this point in the history
- Fix formatting.
- uninstall node-cron so gone from package-lock.json
  • Loading branch information
huss committed Dec 10, 2024
1 parent f7006f2 commit 08c24c9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 50 deletions.
32 changes: 0 additions & 32 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 17 additions & 18 deletions src/server/services/checkWebsiteStatus.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,22 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

const { log } = require('../log');
const WEBSITE_URL = process.argv[2];

async function checkWebsite() {
try {
const response = await fetch(WEBSITE_URL, { method: 'HEAD' });

if (!response.ok) {
const errorMessage = `The server at ${WEBSITE_URL} is down.`;
// Log the error using Logger class
log.error(errorMessage);
}
} catch (error) {
const errorMessage = `Failed to reach ${WEBSITE_URL}. Error: ${error.message}`;
log.error(errorMessage, error);
const { log } = require('../log');
const WEBSITE_URL = process.argv[2];

async function checkWebsite() {
try {
const response = await fetch(WEBSITE_URL, { method: 'HEAD' });

if (!response.ok) {
const errorMessage = `The server at ${WEBSITE_URL} is down.`;
// Log the error using Logger class
log.error(errorMessage);
}
} catch (error) {
const errorMessage = `Failed to reach ${WEBSITE_URL}. Error: ${error.message}`;
log.error(errorMessage, error);
}
checkWebsite();
}

checkWebsite();

0 comments on commit 08c24c9

Please sign in to comment.