On Wednesday, April 15, 2020 at 1:09:14 PM UTC-7, BeeRich33 wrote:
>
> Sorry, getting back to this.  
>
> OK, good to know the checkin/checkout status.  
>
> I've set this up for a DB server on the LAN.
>
> DBNS = Sequel.connect('postgres://myun:[email protected]:5432/alpha')
>
> DBNS.extension(:connection_validator)
>
> DBNS.pool.connection_validation_timeout = -1
>
> DBNS.log_connection_info = true
>
> p DBNS.get(1)
>
> # Drop the connection socket:
> /([\d.]+:\d+) --> ([\d.]+:\d+)/ =~ `fstat -n | fgrep 5432`
> system('tcpdrop', $1, $2)
>
> p DBNS.get(1)
>
> Result:
>
> LOG:  statement: SET standard_conforming_strings = ON
> LOG:  statement: SET client_min_messages = 'WARNING'
> LOG:  statement: SET standard_conforming_strings = ON
> LOG:  statement: SET client_min_messages = 'WARNING'
> 1
> sh: fstat: command not found
> Traceback (most recent call last):
> 1: from /users/rich/app2.rb:28:in `<main>'
> /users/rich/app2.rb:28:in `system': no implicit conversion of nil into 
> String (TypeError)
>
> Can't find fstat for some reason.  There's a man page.  
>

 The example code I gave for dropping connections (fstat/fgrep/tcpdrop) is 
for the operating system I use (OpenBSD).  If you want to test dropping the 
connection, you'll have to change it to whatever is appropriate for your 
operating system.

Thanks,
Jeremy

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sequel-talk/a407b3bf-cf24-4ce1-b254-5c1e2b2b1616%40googlegroups.com.

Reply via email to