#1169 frontend: cache repofile contents
Merged 4 years ago by praiskup. Opened 4 years ago by praiskup.
Unknown source cache-repo-contents  into  master

@@ -21,6 +21,7 @@

  

  from copr_common.enums import StatusEnum

  from coprs import app

+ from coprs import cache

  from coprs import db

  from coprs import rcp

  from coprs import exceptions
@@ -722,6 +723,7 @@

  @coprs_ns.route("/g/<group_name>/<copr_dirname>/repo/<name_release>/", defaults={"repofile": None})

  @coprs_ns.route("/g/<group_name>/<copr_dirname>/repo/<name_release>/<repofile>")

  @req_with_copr_dir

+ @cache.memoize(timeout=5*60)

  def generate_repo_file(copr_dir, name_release, repofile):

      """ Generate repo file for a given repo name.

          Reponame = username-coprname """

@@ -14,6 +14,7 @@

  from copr_common.enums import ActionTypeEnum, BackendResultEnum, StatusEnum

  from coprs import helpers

  from coprs import models

+ from coprs import cache

  from coprs.logic.coprs_logic import BranchesLogic

  

  from unittest import mock
@@ -72,6 +73,7 @@

  

          self.rmodel_TSE_coprs_general_patcher.stop()

          self.app.config = self.original_config.copy()

+         cache.clear()

  

      @property

      def auth_header(self):

@@ -8,7 +8,7 @@

  from sqlalchemy import desc

  

  from copr_common.enums import ActionTypeEnum

- from coprs import app, models

+ from coprs import app, cache, models

  

  from coprs.logic.coprs_logic import CoprsLogic, CoprDirsLogic

  from coprs.logic.actions_logic import ActionsLogic
@@ -851,6 +851,7 @@

              # Only one chroot enabled, alias defined

              self.c1.copr_chroots = [cc_rhelbeta]

              self.db.session.commit()

+             cache.clear()

              r1 = self.tc.get(url.format(chroot="epel-8", **kwargs))

              r2 = self.tc.get(url.format(chroot="rhelbeta-8", **kwargs))

              assert "baseurl=https://foo/results/user1/foocopr/rhelbeta-8-$basearch/" in r1.data.decode("utf-8")

no initial comment

rebased onto 08e9b7c

4 years ago

2 new commits added

  • frontend: cache repository contents
  • frontend: clear caches after each test
4 years ago

Commit 9722f1f fixes this pull-request

Pull-Request has been merged by praiskup

4 years ago

Pull-Request has been merged by praiskup

4 years ago