Project

General

Profile

action #61919

job_groups_and_parents is called for every request including images and api calls

Added by tinita 6 months ago. Updated 6 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Concrete Bugs
Target version:
Start date:
2020-01-08
Due date:
% Done:

100%

Estimated time:
Difficulty:
Duration:

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.

History

#1 Updated by tinita 6 months ago

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

#2 Updated by tinita 6 months ago

  • Description updated (diff)

#3 Updated by tinita 6 months 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

#4 Updated by tinita 6 months ago

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

#6 Updated by tinita 6 months ago

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

#7 Updated by tinita 6 months ago

  • Status changed from Feedback to Resolved

PR merged and deployed

Also available in: Atom PDF