Skip to content

Commit

Permalink
Refactor names of script commands
Browse files Browse the repository at this point in the history
  • Loading branch information
iaincollins committed Sep 30, 2024
1 parent 15ebe0e commit 5cd6f6f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ other versions of Node.js.

After doing `npm install` you can run the service with `npm start`.

You may need to run additional commands like `npm run commodity-stats` and
`npm run database-stats` to generate at least once to avoid errors, but the
process will run these automatically if left running for long enough (they
are scheduled tasks that run periodically).
You may need to run `npm run stats` to generate at least once to avoid errors,
but these will automatically if left running for long enough (they are scheduled
tasks that run periodically, at least once a day).

## Credits

Expand Down
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ if (SAVE_PAYLOAD_EXAMPLES === true &&
// block anything but the queries are quite heavy as they involve
// scanning and performing analysis on the entire trading database so we
// only do it once a day.
exec('npm run commodity-stats', (error, stdout, stderr) => {
exec('npm run stats:commodity', (error, stdout, stderr) => {
if (error) console.error(error)
})

Expand All @@ -129,7 +129,7 @@ if (SAVE_PAYLOAD_EXAMPLES === true &&
// It can take around 15 minutes but does not impact the live database.
// Downloads of backups during the maintaince window may fail when the
// backup images are updated.
exec('npm run compress-backups', (error, stdout, stderr) => {
exec('npm run backup:compress', (error, stdout, stderr) => {
if (error) console.error(error)
})
})
Expand All @@ -141,7 +141,7 @@ if (SAVE_PAYLOAD_EXAMPLES === true &&
// @TODO Could maybe be real time if replaced with triggers on tables,
// or a best-effort internal counter that tracks changes between updates.
cron.schedule('0 0 * * * *', () => {
exec('npm run database-stats', (error, stdout, stderr) => {
exec('npm run stats:database', (error, stdout, stderr) => {
if (error) console.error(error)
})
})
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"name": "ardent-collector",
"version": "1.54.3",
"version": "1.54.4",
"description": "Ardent Collector saves data submitted to EDDN",
"main": "index.js",
"scripts": {
"start": "node index.js",
"test": "node tests",
"download": "node scripts/download.js",
"backup": "node scripts/backup.js",
"compress-backups": "node scripts/compress-backups.js",
"backup:compress": "node scripts/backup-compress.js",
"restore": "node scripts/restore.js",
"optimize": "node scripts/optimize.js",
"stats": "npm run database-stats && npm run commodity-stats",
"database-stats": "node scripts/stats/database-stats.js",
"commodity-stats": "node scripts/stats/commodity-stats.js",
"stats": "npm run stats:database && npm run stats:commodity",
"stats:database": "node scripts/stats/database-stats.js",
"stats:commodity": "node scripts/stats/commodity-stats.js",
"lint": "npx standard --fix"
},
"repository": {
Expand Down
File renamed without changes.

0 comments on commit 5cd6f6f

Please sign in to comment.