Skip to content

Conversation

@junderw
Copy link
Member

@junderw junderw commented Oct 9, 2023

This adds:

  1. A cronjob to run the popular-scripts.txt generation job.
  2. Conditional running of the generation job only when the file is not present.

I am shell noob, be kind.

@junderw junderw force-pushed the junderw/start-script-fix branch from 3e348be to 3ce7053 Compare October 9, 2023 15:14
@junderw junderw force-pushed the junderw/start-script-fix branch from 3ce7053 to a8aba23 Compare October 9, 2023 19:12
@wiz wiz merged commit b6d2124 into mempool Dec 13, 2024
3 checks passed
@wiz wiz deleted the junderw/start-script-fix branch December 13, 2024 01:18
if [ ! -e "${POPULAR_SCRIPTS_FILE}" ];then
generate_popular_scripts
fi
# if [ ! -e "${POPULAR_SCRIPTS_FILE}" ];then
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you commented out the wrong thing.

You left the "add crontab" if block

But commented out the "perform popular_scripts job" if block

If you run this, it will add the cron job but not run the actual job when the file is missing, and the electrs run command will fail when it tries to run the cache operations on a file that doesn't exist.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, switching the if block you comment out will change the behavior from

"Always run the popular_script job before running electrs" (current)

to

"Only run the popular_script job when the file doesn't exist. Otherwise, the cron job should have kept the file up to date for us so we shouldn't need to run it" (This PR)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants