forked from lix-project/hydra
search: limit queries to 20s
Even 20s is really long, but it cuts off queries which are today running for 500+s.
This commit is contained in:
parent
4f308b1f2f
commit
91e63fb7da
|
@ -442,6 +442,8 @@ sub search :Local Args(0) {
|
|||
my $limit = int(trim ($c->request->params->{"limit"} || "10"));
|
||||
$c->stash->{limit} = min(50, max(1, $limit));
|
||||
|
||||
$c->model('DB')->schema->txn_do(sub {
|
||||
$c->model('DB')->schema->storage->dbh->do("SET LOCAL statement_timeout = 20000");
|
||||
$c->stash->{projects} = [ $c->model('DB::Projects')->search(
|
||||
{ -and =>
|
||||
[ { -or => [ name => { ilike => "%$query%" }, displayName => { ilike => "%$query%" }, description => { ilike => "%$query%" } ] }
|
||||
|
@ -486,6 +488,7 @@ sub search :Local Args(0) {
|
|||
jobsets => $c->stash->{jobsets},
|
||||
builds => $c->stash->{builds},
|
||||
buildsdrv => $c->stash->{buildsdrv} };
|
||||
});
|
||||
}
|
||||
|
||||
sub serveLogFile {
|
||||
|
|
Loading…
Reference in a new issue