mirror of
https://github.com/YunoHost-Apps/gitlab_ynh.git
synced 2024-09-03 18:36:35 +02:00
create swap only if the server has less than 4Go of RAM
This commit is contained in:
parent
42f34f3a17
commit
f18afe6ffb
3 changed files with 9 additions and 9 deletions
|
@ -75,13 +75,13 @@ ynh_app_setting_set --app=$app --key=puma_min_threads --value=$puma_min_threads
|
|||
# ADD SWAP IF NEEDED
|
||||
#=================================================
|
||||
|
||||
total_swap=$(ynh_get_ram --total --only_swap)
|
||||
total_ram=$(ynh_get_ram --total)
|
||||
swap_needed=0
|
||||
|
||||
# https://docs.gitlab.com/ce/install/requirements.html#memory
|
||||
# Need at least 2Go of swap
|
||||
if [ $total_swap -lt 2048 ]; then
|
||||
swap_needed=$((2048 - total_swap))
|
||||
if [ $total_ram -lt 4096 ]; then
|
||||
swap_needed=2048
|
||||
fi
|
||||
|
||||
if [ $swap_needed -gt 0 ]; then
|
||||
|
|
|
@ -22,13 +22,13 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
|||
# ADD SWAP IF NEEDED
|
||||
#=================================================
|
||||
|
||||
total_swap=$(ynh_get_ram --total --only_swap)
|
||||
total_ram=$(ynh_get_ram --total)
|
||||
swap_needed=0
|
||||
|
||||
# https://docs.gitlab.com/ce/install/requirements.html#memory
|
||||
# Need at least 2Go of swap
|
||||
if [ $total_swap -lt 2048 ]; then
|
||||
swap_needed=$((2048 - total_swap))
|
||||
if [ $total_ram -lt 4096 ]; then
|
||||
swap_needed=2048
|
||||
fi
|
||||
|
||||
if [ $swap_needed -gt 0 ]; then
|
||||
|
|
|
@ -94,13 +94,13 @@ ynh_app_setting_set --app=$app --key=puma_worker_processes --value=$puma_worker_
|
|||
# ADD SWAP IF NEEDED
|
||||
#=================================================
|
||||
|
||||
total_swap=$(ynh_get_ram --total --only_swap)
|
||||
total_ram=$(ynh_get_ram --total)
|
||||
swap_needed=0
|
||||
|
||||
# https://docs.gitlab.com/ce/install/requirements.html#memory
|
||||
# Need at least 2Go of swap
|
||||
if [ $total_swap -lt 2048 ]; then
|
||||
swap_needed=$((2048 - total_swap))
|
||||
if [ $total_ram -lt 4096 ]; then
|
||||
swap_needed=2048
|
||||
fi
|
||||
|
||||
if [ $swap_needed -gt 0 ]; then
|
||||
|
|
Loading…
Reference in a new issue