def pool.clean

bend-kit-postgres@0.3.0.0 · postgres.bend:645

import bend-kit-postgres@0.3.0.0/postgres.bend as Postgres
import Base

645def pool.clean(clean: Bool, p: Pool, c: Conn) -> IO(Pool):
646  match clean:
647    case True{}:
648      Pool{+cap, idle} = p
649      Conn{tls, sock, rd, +k, ms, status} = c
650      pool.keep(cap, k, Conn{tls, sock, rd, k, ms, status}, Map.pop(&1, List<&1, Conn>, idle, k))
651    case False{}:
652      do IO<Pool>:
653        close(c)
654        return p

Uses (11)

Used by (1)