From 347d33d96ef43775ea55aa14e43a6ac314abd2bb Mon Sep 17 00:00:00 2001 From: Micke Nordin Date: Thu, 1 Jun 2023 13:04:46 +0200 Subject: [PATCH] Simplify config.ph with redis_seeds --- templates/application/config.php.erb | 50 +++------------------------- 1 file changed, 4 insertions(+), 46 deletions(-) diff --git a/templates/application/config.php.erb b/templates/application/config.php.erb index f804137..00c52c9 100644 --- a/templates/application/config.php.erb +++ b/templates/application/config.php.erb @@ -101,57 +101,15 @@ $CONFIG = array ( 'overwritehost' => '<%= @site_name %>', 'overwriteprotocol' => 'https', 'passwordsalt' => '<%= @passwordsalt %>', -<% if @location == 'gss-test' -%> +<% if ! @is_multinode -%> 'redis.cluster' => [ 'failover_mode' => \RedisCluster::FAILOVER_ERROR, 'password' => '<%= @redis_cluster_password %>', 'read_timeout' => 0.0, 'seeds' => [ - 'redis1.drive.test.sunet.se:6379', - 'redis2.drive.test.sunet.se:6379', - 'redis3.drive.test.sunet.se:6379', - 'redis1.drive.test.sunet.se:6380', - 'redis2.drive.test.sunet.se:6380', - 'redis3.drive.test.sunet.se:6380', - 'redis1.drive.test.sunet.se:6381', - 'redis2.drive.test.sunet.se:6381', - 'redis3.drive.test.sunet.se:6381' - ], - 'timeout' => 1.1 - ], -<% elsif @environment == 'test' && ! @is_multinode -%> - 'redis.cluster' => [ - 'failover_mode' => \RedisCluster::FAILOVER_ERROR, - 'password' => '<%= @redis_cluster_password %>', - 'read_timeout' => 0.0, - 'seeds' => [ - 'redis1.<%= @customer %>.drive.test.sunet.se:6379', - 'redis2.<%= @customer %>.drive.test.sunet.se:6379', - 'redis3.<%= @customer %>.drive.test.sunet.se:6379', - 'redis1.<%= @customer %>.drive.test.sunet.se:6380', - 'redis2.<%= @customer %>.drive.test.sunet.se:6380', - 'redis3.<%= @customer %>.drive.test.sunet.se:6380', - 'redis1.<%= @customer %>.drive.test.sunet.se:6381', - 'redis2.<%= @customer %>.drive.test.sunet.se:6381', - 'redis3.<%= @customer %>.drive.test.sunet.se:6381' - ], - 'timeout' => 1.1 - ], -<% elsif @environment == 'prod' && ! @is_multinode && @location != 'gss-prod' -%> - 'redis.cluster' => [ - 'failover_mode' => \RedisCluster::FAILOVER_ERROR, - 'password' => '<%= @redis_cluster_password %>', - 'read_timeout' => 0.0, - 'seeds' => [ - 'redis1.<%= @customer %>.drive.sunet.se:6379', - 'redis2.<%= @customer %>.drive.sunet.se:6379', - 'redis3.<%= @customer %>.drive.sunet.se:6379', - 'redis1.<%= @customer %>.drive.sunet.se:6380', - 'redis2.<%= @customer %>.drive.sunet.se:6380', - 'redis3.<%= @customer %>.drive.sunet.se:6380', - 'redis1.<%= @customer %>.drive.sunet.se:6381', - 'redis2.<%= @customer %>.drive.sunet.se:6381', - 'redis3.<%= @customer %>.drive.sunet.se:6381' +<% @redis_seeds.each do |seed| -%> + '<%= seed['host'] %>:<%= seed['port'] %>', +<% end -%> ], 'timeout' => 1.1 ],