Skip to content

Commit

Permalink
Match standard terminology
Browse files Browse the repository at this point in the history
Uses by Fly.io, Heroku, Flask etc.
  • Loading branch information
thewilkybarkid committed Dec 4, 2023
1 parent 704416d commit 3401d93
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ smoke-test: build-image start-services
REDIS_PORT=$(shell docker compose port redis 6379 | awk -F":" '{print $$2}') scripts/smoke-test.sh ${IMAGE_TAG}

start: node_modules start-services
REDIS_URI=redis://$(shell docker compose port redis 6379) npx tsx --require dotenv/config src
REDIS_URL=redis://$(shell docker compose port redis 6379) npx tsx --require dotenv/config src

start-services:
docker compose up --detach
2 changes: 1 addition & 1 deletion scripts/smoke-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function finish() {
trap finish EXIT

echo "Starting the container"
container=$(docker run --env SLACK_ACCESS_TOKEN=token --env REDIS_URI="redis://host.docker.internal:$REDIS_PORT" --add-host=host.docker.internal:host-gateway --detach "$1")
container=$(docker run --env SLACK_ACCESS_TOKEN=token --env REDIS_URL="redis://host.docker.internal:$REDIS_PORT" --add-host=host.docker.internal:host-gateway --detach "$1")

timeout --foreground 20 bash << EOT
while true; do
Expand Down
2 changes: 1 addition & 1 deletion src/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const slackApiConfig = Config.nested(
)

const redisConfig = Config.nested(
Config.mapAttempt(Config.string('URI'), uri => ({ uri: new URL(uri) }) satisfies RedisConfig),
Config.mapAttempt(Config.string('URL'), url => ({ url: new URL(url) }) satisfies RedisConfig),
'REDIS',
)

Expand Down
4 changes: 2 additions & 2 deletions src/Redis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import IoRedis from 'ioredis'
export type Redis = IoRedis.Redis

export interface RedisConfig {
readonly uri: URL
readonly url: URL
}

export const Redis = Context.Tag<Redis>('IoRedis/Redis')
Expand All @@ -21,7 +21,7 @@ export const layer: Layer.Layer<RedisConfig, never, Redis> = Layer.scoped(
Effect.gen(function* (_) {
const config = yield* _(RedisConfig)

return new IoRedis.Redis(config.uri.href)
return new IoRedis.Redis(config.url.href)
}),
redis => Effect.sync(() => redis.disconnect()),
),
Expand Down

0 comments on commit 3401d93

Please sign in to comment.