File tree 1 file changed +9
-3
lines changed
1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -120,10 +120,16 @@ check_php
120
120
install_if_not php" $PHPVER " -sysvsem
121
121
install_if_not ffmpeg
122
122
123
- # Set default limits
123
+ # Calculate CPU cores
124
124
# https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/config_sample_php_parameters.html#previews
125
- nextcloud_occ config:system:set preview_concurrency_all --value=" 4"
126
- nextcloud_occ config:system:set preview_concurrency_new --value=" 2"
125
+ if which nproc > /dev/null 2>&1
126
+ then
127
+ nextcloud_occ config:system:set preview_concurrency_new --value=" $( nproc) "
128
+ nextcloud_occ config:system:set preview_concurrency_all --value=" $( expr $( nproc) ' *' 2) "
129
+ else
130
+ nextcloud_occ config:system:set preview_concurrency_new --value=" 2"
131
+ nextcloud_occ config:system:set preview_concurrency_all --value=" 4"
132
+ fi
127
133
128
134
# Set providers (https://github.com/nextcloud/server/blob/master/lib/private/Preview/Imaginary.php#L60)
129
135
# https://github.com/nextcloud/vm/issues/2465
You can’t perform that action at this time.
0 commit comments