Skip to content

Commit

Permalink
Remove unnecessary clear_opcache calls, as opcache is now disabled fo…
Browse files Browse the repository at this point in the history
…r cli

Signed-off-by: Tobias Knöppler <[email protected]>
  • Loading branch information
theCalcaholic committed Jan 22, 2023
1 parent 88ec3a8 commit 362c828
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 17 deletions.
5 changes: 1 addition & 4 deletions bin/ncp-restore
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,6 @@ fi

cd "$NCDIR"

clear_opcache

### INCLUDEDATA=yes situation
NUMFILES=2
if [[ $( ls "$TMPDIR" | wc -l ) -eq $NUMFILES ]]; then
Expand Down Expand Up @@ -183,6 +181,5 @@ ncc files:scan-app-data

# restart PHP if needed
[[ "$NEED_RESTART" == "1" ]] && {
clear_opcache
bash -c "sleep 3; service php${PHPVER}-fpm restart" &>/dev/null &
bash -c "sleep 5; source /usr/local/etc/library.sh; clear_opcache; service php${PHPVER}-fpm restart" &>/dev/null &
}
6 changes: 2 additions & 4 deletions bin/ncp-update-nc
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,6 @@ chown -R www-data:www-data nextcloud
find nextcloud/ -type d -exec chmod 750 {} \;
find nextcloud/ -type f -exec chmod 640 {} \;

# Clear PHP opcache
clear_opcache

# upgrade
####################
echo "Upgrade..."
Expand Down Expand Up @@ -250,7 +247,6 @@ then
apt-get install -y --no-install-recommends -t "$RELEASE" "${PHP_PACKAGES_OLD[@]}"
set_ncpcfg "php_version" "${PHPVER_OLD}"
install_template "php/opcache.ini.sh" "/etc/php/${PHPVER_NEW}/mods-available/opcache.ini"
clear_opcache
run_app nc-limits
a2enconf "php${PHPVER_OLD}-fpm"
service "php${PHPVER_OLD}-fpm" start
Expand Down Expand Up @@ -308,3 +304,5 @@ mv "$BKP" "$DATADIR"/ncp-update-backups
chown -R www-data:www-data "$DATADIR"/ncp-update-backups
BKP="$DATADIR"/ncp-update-backups/"$( basename "$BKP" )"
echo "Backup stored at $BKP"

bash -c "sleep 5; source /usr/local/etc/library.sh; clear_opcache;" &>/dev/null &
3 changes: 1 addition & 2 deletions bin/ncp/CONFIG/nc-limits.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@ configure()

# RESTART PHP
[[ "$require_fpm_restart" == "true" ]] && {
clear_opcache
bash -c "sleep 3; service php${PHPVER}-fpm restart" &>/dev/null &
bash -c "sleep 3; source /usr/local/etc/library.sh; clear_opcache; service php${PHPVER}-fpm restart" &>/dev/null &
}

# redis max memory
Expand Down
3 changes: 2 additions & 1 deletion bin/ncp/TOOLS/clear-php-opcache.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
configure()
{
echo "Clearing opcache..."
clear_opcache
bash -c "sleep 5; source /usr/local/etc/library.sh; clear_opcache;" &>/dev/null &
echo "Done."
}

install() { :; }
Expand Down
5 changes: 1 addition & 4 deletions updates/1.50.0.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,5 @@

set -e
export NCPCFG=/usr/local/etc/ncp.cfg
source /usr/local/etc/library.sh


clear_opcache
bash -c "sleep 6; service php${PHPVER}-fpm restart" &>/dev/null &
bash -c "sleep 6; source /usr/local/etc/library.sh; clear_opcache" &>/dev/null &
3 changes: 1 addition & 2 deletions updates/1.50.1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ source /usr/local/etc/library.sh

install_template systemd/notify_push.service.sh /etc/systemd/system/notify_push.service

clear_opcache
bash -c "sleep 6; service php${PHPVER}-fpm restart" &>/dev/null &
bash -c "sleep 6; source /usr/local/etc/library.sh; clear_opcache; service php${PHPVER}-fpm reload" &>/dev/null &

0 comments on commit 362c828

Please sign in to comment.