Minor adjustments to handling 'infinity' for timeout.

This commit is contained in:
Andrew McMillan 2010-03-12 18:32:11 +13:00
parent 4322e7137a
commit c2b6398afe

View File

@ -64,13 +64,13 @@ foreach( $xmltree->GetContent() AS $k => $v ) {
} }
} }
if ( preg_match( '{^([a-z]+)-(\d+)$}i', $ticket_timeout, $matches ) ) { if ( $ticket_timeout == 'infinity' ) {
$sql_timeout = null;
}
else if ( preg_match( '{^([a-z]+)-(\d+)$}i', $ticket_timeout, $matches ) ) {
/** It isn't specified, but timeout seems to be 'unit-number' like 'Seconds-3600', so we make it '3600 Seconds' which PostgreSQL understands */ /** It isn't specified, but timeout seems to be 'unit-number' like 'Seconds-3600', so we make it '3600 Seconds' which PostgreSQL understands */
$sql_timeout = $matches[2] . ' ' . $matches[1]; $sql_timeout = $matches[2] . ' ' . $matches[1];
} }
else if ( $ticket_timeout == 'infinity' ) {
$sql_timeout = null;
}
else { else {
$sql_timeout = $ticket_timeout; $sql_timeout = $ticket_timeout;
} }