def pool.clean
import bend-kit-postgres@0.3.0.0/postgres.bend as Postgresimport 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