mhsf-dev/cron
2024-09-07 09:17:09 -05:00
..
src fix: fixing hero gap and enhancing cron 2024-09-07 09:17:09 -05:00
.gitignore fix: fixing hero gap and enhancing cron 2024-09-07 09:17:09 -05:00
config.yaml fix: fixing hero gap and enhancing cron 2024-09-07 09:17:09 -05:00
Dockerfile fix: fixing hero gap and enhancing cron 2024-09-07 09:17:09 -05:00
package-lock.json 1.0! 2024-08-22 23:44:00 -05:00
package.json fix: fixing hero gap and enhancing cron 2024-09-07 09:17:09 -05:00
README.md fix: fixing hero gap and enhancing cron 2024-09-07 09:17:09 -05:00
tsconfig.json fix: fixing hero gap and enhancing cron 2024-09-07 09:17:09 -05:00
yarn.lock fix: fixing hero gap and enhancing cron 2024-09-07 09:17:09 -05:00

MHSF Cron Tasks

In version 1.0, MHSF moved from using Inngest to collect statistics to a self-hosted crontab Node.js script.

Why the move?

When running Inngest, on Vercel's servers, when doing the /servers Minehut API endpoint to grab the currently online servers, a Cloudflare pop-up appeared. This made it so the JSON data expected, was blocked. This appeared to only run on Vercel's servers, and the only real solution (without spending a lot of money) was to run a minimal script every 30 minutes to grab the server data.

How do you run this?

Make sure you have a MongoDB database set-up and ready with a file in the previous directory (..) named .env.local with the key MONGO_DB as the database URL. You can also just set an environment variable. Simply run the following to test:

npm install
npm run dev

and to deploy using Docker:

npm run build
docker build -t mhsf-dbref .

# run the container
docker run --name mhsf-dbref <name for container>