From 8b0e25966e5f036a791613102fdf080bb35988a8 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Wed, 14 Feb 2024 12:20:53 +0200 Subject: [PATCH] Ensure cache_autotuning.max_cache_memory_usage & cache_autotuning.target_cache_memory_usage have int values Fixes Synapse failing to start with: > ValueError: invalid literal for int() with base 10: '2027264.0 Related to: https://github.com/spantaleev/matrix-docker-ansible-deploy/pull/3017 --- roles/custom/matrix-synapse/defaults/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/custom/matrix-synapse/defaults/main.yml b/roles/custom/matrix-synapse/defaults/main.yml index 9b9f068fd..2a137f006 100644 --- a/roles/custom/matrix-synapse/defaults/main.yml +++ b/roles/custom/matrix-synapse/defaults/main.yml @@ -562,8 +562,8 @@ matrix_synapse_cache_autotuning_min_cache_ttl: "30s" # The memtotal variable can in theory be overiden to make Synapse think it has less ram to work with. # But if your at the point of considering that just override the math or put static values in. matrix_synapse_memtotal_kb: "{{ ansible_memtotal_mb*1024|int }}" -matrix_synapse_cache_autotuning_max_cache_memory_usage: "{{ 2097152 if (matrix_synapse_memtotal_kb|int/8)/1024 >= 2048 else matrix_synapse_memtotal_kb|int/8 }}" -matrix_synapse_cache_autotuning_target_cache_memory_usage: "{{ 1048576 if (matrix_synapse_memtotal_kb|int/16)/1024 >= 1024 else matrix_synapse_memtotal_kb|int/16 }}" +matrix_synapse_cache_autotuning_max_cache_memory_usage: "{{ (2097152 if (matrix_synapse_memtotal_kb|int/8)/1024 >= 2048 else matrix_synapse_memtotal_kb|int/8) | int }}" +matrix_synapse_cache_autotuning_target_cache_memory_usage: "{{ (1048576 if (matrix_synapse_memtotal_kb|int/16)/1024 >= 1024 else matrix_synapse_memtotal_kb|int/16) | int }}" # Controls whether Synapse will federate at all. # Disable this to completely isolate your server from the rest of the Matrix network.