Skip to content

Commit 362c828

Browse files
committed
Remove unnecessary clear_opcache calls, as opcache is now disabled for cli
Signed-off-by: Tobias Knöppler <[email protected]>
1 parent 88ec3a8 commit 362c828

File tree

6 files changed

+8
-17
lines changed

6 files changed

+8
-17
lines changed

bin/ncp-restore

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,6 @@ fi
103103

104104
cd "$NCDIR"
105105

106-
clear_opcache
107-
108106
### INCLUDEDATA=yes situation
109107
NUMFILES=2
110108
if [[ $( ls "$TMPDIR" | wc -l ) -eq $NUMFILES ]]; then
@@ -183,6 +181,5 @@ ncc files:scan-app-data
183181

184182
# restart PHP if needed
185183
[[ "$NEED_RESTART" == "1" ]] && {
186-
clear_opcache
187-
bash -c "sleep 3; service php${PHPVER}-fpm restart" &>/dev/null &
184+
bash -c "sleep 5; source /usr/local/etc/library.sh; clear_opcache; service php${PHPVER}-fpm restart" &>/dev/null &
188185
}

bin/ncp-update-nc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,6 @@ chown -R www-data:www-data nextcloud
184184
find nextcloud/ -type d -exec chmod 750 {} \;
185185
find nextcloud/ -type f -exec chmod 640 {} \;
186186

187-
# Clear PHP opcache
188-
clear_opcache
189-
190187
# upgrade
191188
####################
192189
echo "Upgrade..."
@@ -250,7 +247,6 @@ then
250247
apt-get install -y --no-install-recommends -t "$RELEASE" "${PHP_PACKAGES_OLD[@]}"
251248
set_ncpcfg "php_version" "${PHPVER_OLD}"
252249
install_template "php/opcache.ini.sh" "/etc/php/${PHPVER_NEW}/mods-available/opcache.ini"
253-
clear_opcache
254250
run_app nc-limits
255251
a2enconf "php${PHPVER_OLD}-fpm"
256252
service "php${PHPVER_OLD}-fpm" start
@@ -308,3 +304,5 @@ mv "$BKP" "$DATADIR"/ncp-update-backups
308304
chown -R www-data:www-data "$DATADIR"/ncp-update-backups
309305
BKP="$DATADIR"/ncp-update-backups/"$( basename "$BKP" )"
310306
echo "Backup stored at $BKP"
307+
308+
bash -c "sleep 5; source /usr/local/etc/library.sh; clear_opcache;" &>/dev/null &

bin/ncp/CONFIG/nc-limits.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,7 @@ configure()
8080

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

8786
# redis max memory

bin/ncp/TOOLS/clear-php-opcache.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
configure()
1313
{
1414
echo "Clearing opcache..."
15-
clear_opcache
15+
bash -c "sleep 5; source /usr/local/etc/library.sh; clear_opcache;" &>/dev/null &
16+
echo "Done."
1617
}
1718

1819
install() { :; }

updates/1.50.0.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,5 @@
22

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

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

updates/1.50.1.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,4 @@ source /usr/local/etc/library.sh
66

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

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

0 commit comments

Comments
 (0)