File tree Expand file tree Collapse file tree 5 files changed +16
-3
lines changed Expand file tree Collapse file tree 5 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -3,3 +3,4 @@ DATABASE_PORT=6432
33DATABASE_NAME=spi_dev
44DATABASE_USERNAME=spi_dev
55DATABASE_PASSWORD=xxx
6+ REDIS_HOST=localhost
Original file line number Diff line number Diff line change @@ -3,3 +3,4 @@ DATABASE_PORT=5432
33DATABASE_NAME=spi_test
44DATABASE_USERNAME=spi_test
55DATABASE_PASSWORD=xxx
6+ REDIS_HOST=localhost
Original file line number Diff line number Diff line change @@ -92,7 +92,13 @@ ingest:
9292analyze :
9393 swift run Run analyze --limit 1
9494
95- db-up : db-up-dev db-up-test
95+ redis-up-dev :
96+ docker run --name spi_redis -p 6379:6379 -d redis/redis-stack:7.4.0-v1
97+
98+ redis-down-dev :
99+ docker rm -f spi_redis
100+
101+ db-up : db-up-dev db-up-test redis-up-dev
96102
97103db-up-dev :
98104 docker run --name spi_dev -e POSTGRES_DB=spi_dev -e POSTGRES_USER=spi_dev -e POSTGRES_PASSWORD=xxx -p 6432:5432 -d postgres:16-alpine
@@ -111,7 +117,7 @@ db-up-test:
111117 -d \
112118 postgres:13-alpine
113119
114- db-down : db-down-dev db-down-test
120+ db-down : db-down-dev db-down-test redis-down-dev
115121
116122db-down-dev :
117123 docker rm -f spi_dev
Original file line number Diff line number Diff line change @@ -80,7 +80,11 @@ public func configure(_ app: Application) async throws -> String {
8080
8181 // Setup Redis connection
8282 do {
83- app. redis. configuration = try RedisConfiguration ( hostname: " redis " )
83+ if let redisHost = Environment . get ( " REDIS_HOST " ) {
84+ app. redis. configuration = try RedisConfiguration ( hostname: redisHost)
85+ } else {
86+ app. logger. warning ( " REDIS_HOST not set, caching disabled. " )
87+ }
8488 } catch {
8589 app. logger. warning ( " Failed to configure Redis, caching disabled. Error: \( error) " )
8690 }
Original file line number Diff line number Diff line change @@ -63,6 +63,7 @@ x-shared: &shared
6363 TWITTER_API_SECRET : ${TWITTER_API_SECRET}
6464 TWITTER_ACCESS_TOKEN_KEY : ${TWITTER_ACCESS_TOKEN_KEY}
6565 TWITTER_ACCESS_TOKEN_SECRET : ${TWITTER_ACCESS_TOKEN_SECRET}
66+ REDIS_HOST : ${REDIS_HOST}
6667 volumes :
6768 - checkouts:/checkouts
6869
You can’t perform that action at this time.
0 commit comments