Project

General

Profile

Actions

action #61919

closed

job_groups_and_parents is called for every request including images and api calls

Added by tinita over 4 years ago. Updated over 4 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Regressions/Crashes
Target version:
Start date:
2020-01-08
Due date:
% Done:

100%

Estimated time:

Description

https://github.com/os-autoinst/openQA/blob/master/lib/OpenQA/WebAPI.pm#L87

$self->hook(
    before_dispatch => sub {
        my ($controller) = @_;
        OpenQA::Setup::set_secure_flag_on_cookies($controller);
        $controller->stash('job_groups_and_parents', job_groups_and_parents);
    });

The function makes two DB queries.
That means there are many unnecessary DB queries on some pages.
I can see the call 5 times on the "All Tests" page and two times on the test overview.

We should find out in that call if we deliver a HTML page or something else and only do that call for HTML.

Actions #1

Updated by tinita over 4 years ago

One possibility could be to check if the url starts with /asset/ or /api/ and then skip the call. Other ideas?

Actions #2

Updated by tinita over 4 years ago

  • Description updated (diff)
Actions #3

Updated by tinita over 4 years ago

  • Subject changed from job_groups_and_parents is called for every request including images to job_groups_and_parents is called for every request including images and api calls
Actions #4

Updated by tinita over 4 years ago

  • Status changed from New to In Progress
  • Assignee set to tinita
  • Target version changed from future to Current Sprint
Actions #6

Updated by tinita over 4 years ago

  • Status changed from In Progress to Feedback
  • % Done changed from 0 to 100
Actions #7

Updated by tinita over 4 years ago

  • Status changed from Feedback to Resolved

PR merged and deployed

Actions

Also available in: Atom PDF