Skip to content

Commit 0335b22

Browse files
committed
chore: improved doctrine cache configuration
allow to spec out the store Signed-off-by: smarcet@gmail.com <smarcet@gmail.com> Change-Id: I1937d478f89662998eb5408ccd7036f87cee10d4
1 parent 5fa22d1 commit 0335b22

3 files changed

Lines changed: 15 additions & 3 deletions

File tree

config/cache.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,14 @@
5757
],
5858
],
5959
],
60-
6160
'redis' => [
6261
'driver' => 'redis',
6362
'connection' => env('CACHE_REDIS_CONN', 'cache'),
6463
],
65-
64+
'doctrine_redis' => [
65+
'driver' => 'redis',
66+
'connection' => env('DOCTRINE_CACHE_REDIS_CONN', 'doctrine_cache'),
67+
],
6668
],
6769

6870
/*

config/database.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,14 @@
138138
'timeout' => env('REDIS_TIMEOUT', 30.0),
139139
'scheme' => env('REDIS_SCHEME', 'tcp'),
140140
],
141+
'doctrine_cache' => [
142+
'host' => env('REDIS_HOST'),
143+
'port' => env('REDIS_PORT'),
144+
'database' => env('REDIS_DOCTRINE_CACHE_DB', 5),
145+
'password' => env('REDIS_PASSWORD'),
146+
'timeout' => env('REDIS_TIMEOUT', 30.0),
147+
'scheme' => env('REDIS_SCHEME', 'tcp'),
148+
],
141149
],
142150
'allow_disabled_pk' => env('ALLOW_DISABLED_PK', false),
143151
];

config/doctrine.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,22 +227,24 @@
227227
'region_lifetime' => 3600,
228228
'region_lock_lifetime' => 60,
229229
'regions' => [
230-
231230
],
232231
'log_enabled' => true,
233232
'file_lock_region_directory' => '/tmp'
234233
],
235234
'metadata' => [
236235
'driver' => env('DOCTRINE_METADATA_CACHE', env('DOCTRINE_CACHE', 'redis')),
237236
'namespace' => null,
237+
'store' => env('DOCTRINE_QUERY_CACHE_STORE', 'doctrine_redis'),
238238
],
239239
'query' => [
240240
'driver' => env('DOCTRINE_QUERY_CACHE', env('DOCTRINE_CACHE', 'redis')),
241241
'namespace' => null,
242+
'store' => env('DOCTRINE_QUERY_CACHE_STORE', 'doctrine_redis'),
242243
],
243244
'result' => [
244245
'driver' => env('DOCTRINE_RESULT_CACHE', env('DOCTRINE_CACHE', 'redis')),
245246
'namespace' => null,
247+
'store' => env('DOCTRINE_QUERY_CACHE_STORE', 'doctrine_redis'),
246248
],
247249
],
248250

0 commit comments

Comments
 (0)