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

cache the list of categories #488

Closed
dlangille opened this issue Nov 9, 2023 · 4 comments
Closed

cache the list of categories #488

dlangille opened this issue Nov 9, 2023 · 4 comments
Assignees

Comments

@dlangille
Copy link
Contributor

re #473 (comment)

@dlangille dlangille self-assigned this Nov 9, 2023
@dlangille
Copy link
Contributor Author

freshports.devgit=# grant select on categories to reading_dev_git;
GRANT

@dlangille
Copy link
Contributor Author

so far:

[23:00 dev-ingress01 dan ~/scripts] % cat ~/scripts/categories_rebuild_search_html.sh 
#!/bin/sh

# re: https://github.com/FreshPorts/freshports/issues/488
# Let's cache the list of categories for searching.

. /usr/local/etc/freshports/config.sh

export PGDATABASE=$DB
export PGHOST=$HOST
export PGUSER=$DBUSER

#PGUSER=reporting_dev_git

echo $PGDATABASE $PGHOST $PGUSER

#echo "select '            <OPTION VALUE=\\\"' || name || ''\\\" <?php if \(\$category == ''' || name || '''\) echo ''SELECTED''?>>' || name || '</OPTION>' from categories order by name"
#psql

#psql -c "select '            <OPTION VALUE=\"' || name || ''\" <?php if \(\$category == ''' || name || '''\) echo ''SELECTED''?>>' || name || '</OPTION>' from categories order by name;"
psql -t <<EOF
select '            <OPTION VALUE="'  || name || '"<?php if (\$category == ''' || name || ''') echo '' SELECTED''?>>' || name || '</OPTION>' from categories order by name;
EOF

@dlangille
Copy link
Contributor Author

NOTE to self: this file should go into ~freshports/cache/html on the ingress host - it is safe there from any cache clearing on the WWW host.

@dlangille
Copy link
Contributor Author

Updated added to test, stage, and prod - waiting for top-of-the-hour periodic scripts to run.

re: https://github.com/FreshPorts/freshports/releases/tag/2.8.2

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

No branches or pull requests

1 participant