summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2019-05-09 13:11:15 +0200
committerYorhel <git@yorhel.nl>2019-05-09 13:11:15 +0200
commitfbd7b71d730edea4d7de5461ebb4ad6c9dd95b83 (patch)
tree4f85ab467f51be4b6e0ac9729d466a411f7662af
parente926f8983857e5b8b072e2c070f2948609c460e3 (diff)
Only update SQL caches on Mondays
-rwxr-xr-xutil/cron.sh8
1 files changed, 6 insertions, 2 deletions
diff --git a/util/cron.sh b/util/cron.sh
index 632afbb..237f7d3 100755
--- a/util/cron.sh
+++ b/util/cron.sh
@@ -9,5 +9,9 @@ PSQL="psql -U manned -Awtq"
./fedora.sh current
./ubuntu.sh current
-echo "============ Updating SQL indices"
-$PSQL -f update_indices.sql
+# Only update indices once a week (on mondays). This process is slow and the data doesn't often change anyway.
+if [ `date +%u` == 1 ]
+then
+ echo "============ Updating SQL indices"
+ $PSQL -f update_indices.sql
+fi