pike.git/
lib/
modules/
Sql.pmod/
pgsql.pike
Branch:
Tag:
Non-build tags
All tags
No tags
2016-02-17
2016-02-17 18:57:17 by Stephen R. van den Berg <srb@cuci.nl>
ab4dceb9fcca303f1deb131ed2999bfab652f2d4 (
21
lines) (+
14
/-
7
)
[
Show
|
Annotate
]
Branch:
8.0
pgsql: Terminate threads when connections are idle.
618:
if(_options && _options.reconnect) // FIXME why can _options be 0? _connectfail(); else
-
catch(
destruct(waitforauthready)
)
;
// FIXME why can it be 0?
-
return;
-
}
-
}
// Do not flush at this point, PostgreSQL 9.4 disapproves
+
destruct(waitforauthready);
+
}
else
// Do not flush at this point, PostgreSQL 9.4 disapproves
procmessage(); }
-
+
}
private void procmessage() { int terminating=0;
1268:
_readyforquerycount=1; _waittocommit=0; qportals->write(1);
-
if(!
(c=
getsocket())
)
-
ERROR
("Couldn't connect to database on %s:%
d\n
",_host,_port);
+
if(!getsocket())
{
+
string msg=sprintf
("Couldn't connect to database on %s:%
d
",_host,_port);
+
if(force) {
+
if(!sizeof(lastmessage) || lastmessage[sizeof(lastmessage)-1]!=msg)
+
lastmessage+=({msg});
+
return 0;
+
} else
+
ERROR(msg+"\n");
+
}
_runtimeparameter=([]); _unnamedportalmux=Thread.Mutex(); unnamedstatement=Thread.Mutex();