Skip to content

Commit

Permalink
Merge pull request #6 from danbarbarito/master
Browse files Browse the repository at this point in the history
Fix spelling mistake in "withConnection" template
  • Loading branch information
guzba authored Oct 1, 2023
2 parents 8427060 + 77c1d2e commit 25b7892
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/pool_borrow_callback.nim
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ proc onBorrow(conn: RedisConn, lastReturned: float) =

let pool = newRedisPool(2, onBorrow = onBorrow)

pool.withConnnection conn:
pool.withConnection conn:
echo "Borrowed ", conn
4 changes: 2 additions & 2 deletions src/ready/pools.nim
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ proc borrow*(pool: RedisPool): RedisConn {.gcsafe.} =
if pool.onBorrow != nil:
pool.onBorrow(result, epochTime())

template withConnnection*(pool: RedisPool, conn, body) =
template withConnection*(pool: RedisPool, conn, body) =
block:
let conn = pool.borrow()
try:
Expand All @@ -105,5 +105,5 @@ proc command*(
): RedisReply =
## Borrows a Redis connection from the pool, sends a command to the
## server and receives the reply.
pool.withConnnection conn:
pool.withConnection conn:
result = conn.command(command, args)
2 changes: 1 addition & 1 deletion tests/test.nim
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ block:
discard conn.command("PING")

let pool = newRedisPool(1, onConnect = onConnect, onBorrow = onBorrow)
pool.withConnnection redis:
pool.withConnection redis:
discard redis.command("SET", "mynumber", "0")
redis.send("INCR", "mynumber")
redis.send("INCR", "mynumber")
Expand Down

0 comments on commit 25b7892

Please sign in to comment.