The intention was indeed to try again, but RaiseError on DBI->connect()
evidently also raises error on connection failure.
while (!defined($dbh) || !$dbh->ping) {
print STDERR "Database connection lost, reconnecting...\n";
sleep 1;
while (!defined($dbh) || !$dbh->ping) {
print STDERR "Database connection lost, reconnecting...\n";
sleep 1;
+ eval {
+ $dbh = db_connect();
+ };
}
my $s = IO::Select->new($dbh->{pg_socket});
my @ready = $s->can_read(150.0); # slack.com HTTP timeout is ~3 minutes, sheets.googleapis.com is ~4 minutes.
}
my $s = IO::Select->new($dbh->{pg_socket});
my @ready = $s->can_read(150.0); # slack.com HTTP timeout is ~3 minutes, sheets.googleapis.com is ~4 minutes.