Change the way we deploy ebooks from destroying the entire apcu cache and rebuilding on the next web request, to rebuilding in the background

This commit is contained in:
Alex Cabal 2020-02-29 22:29:19 -06:00
parent d56cb360cc
commit bd4dd7baa2
6 changed files with 192 additions and 157 deletions

View file

@ -25,6 +25,6 @@ fi
# If this script is run by a user without sudo powers, they can be given for this command by creating a file in sudoers.d with:
# MY_USERNAME ALL=(www-data) NOPASSWD: /usr/bin/env SCRIPT_FILENAME=/tmp/php-fpm-opcache-reset.php REQUEST_METHOD=GET cgi-fcgi -bind -connect *
echo '<?php opcache_reset(); if(function_exists("apcu_clear_cache")){ apcu_clear_cache(); } ?>' > /tmp/php-fpm-opcache-reset.php
echo '<?php opcache_reset();?>' > /tmp/php-fpm-opcache-reset.php
sudo -u www-data env SCRIPT_FILENAME=/tmp/php-fpm-opcache-reset.php REQUEST_METHOD=GET cgi-fcgi -bind -connect "/run/php/$1.sock" &> /dev/null
rm /tmp/php-fpm-opcache-reset.php