Skip to content

Commit

Permalink
fix: fix memcache config (#730)
Browse files Browse the repository at this point in the history
  • Loading branch information
asbiin authored Apr 9, 2021
1 parent c3d9eec commit 7e11887
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions config/cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,19 +109,21 @@
// on fortrabbit: construct credentials from App secrets
if (getenv('APP_SECRETS')) {
$secrets = json_decode(file_get_contents(getenv('APP_SECRETS')), true);
$servers = [[
'host' => $secrets['MEMCACHE']['HOST1'],
'port' => $secrets['MEMCACHE']['PORT1'],
'weight' => 100,
]];
if ($secrets['MEMCACHE']['COUNT'] > 1) {
$servers []= [
'host' => $secrets['MEMCACHE']['HOST2'],
'port' => $secrets['MEMCACHE']['PORT2'],
if (array_key_exists('MEMCACHE', $secrets)) {
$servers = [[
'host' => $secrets['MEMCACHE']['HOST1'],
'port' => $secrets['MEMCACHE']['PORT1'],
'weight' => 100,
];
]];
if ($secrets['MEMCACHE']['COUNT'] > 1) {
$servers []= [
'host' => $secrets['MEMCACHE']['HOST2'],
'port' => $secrets['MEMCACHE']['PORT2'],
'weight' => 100,
];
}
Arr::set($config, 'stores.memcached.servers', $servers);
}
Arr::set($config, 'stores.memcached.servers', $servers);
}

if (extension_loaded('memcached')) {
Expand Down

0 comments on commit 7e11887

Please sign in to comment.