From 5d406689fa00204b7bde73e27391e62a1903634c Mon Sep 17 00:00:00 2001 From: Andrew Brain Date: Mon, 11 Mar 2024 18:40:42 -0500 Subject: [PATCH 1/3] Add potential fix Signed-off-by: Andrew Brain --- augur/api/server.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/augur/api/server.py b/augur/api/server.py index 7e78716ee2..8cbfc0718c 100644 --- a/augur/api/server.py +++ b/augur/api/server.py @@ -25,9 +25,8 @@ from augur.application.logs import AugurLogger -from augur.application.db.lib import get_value from augur.application.db.session import DatabaseSession -from augur.application.db import get_engine +from augur.application.config import AugurConfig from augur.application.db.engine import get_database_string, create_database_engine from metadata import __version__ as augur_code_version from augur.application.db.models import Repo, Issue, PullRequest, Message, PullRequestReview, Commit, IssueAssignee, PullRequestAssignee, PullRequestCommit, PullRequestFile, Contributor, IssueLabel, PullRequestLabel, ContributorsAlias, Release, ClientApplication @@ -318,7 +317,7 @@ def get_server_cache(cache_manager) -> Cache: server cache """ - expire = int(get_value('Server', 'cache_expire')) + expire = int(augur_config.get_value('Server', 'cache_expire')) server_cache = cache_manager.get_cache('server', expire=expire) server_cache.clear() @@ -329,6 +328,7 @@ def get_server_cache(cache_manager) -> Cache: url = get_database_string() engine = create_database_engine(url, poolclass=StaticPool) db_session = DatabaseSession(logger, engine) +augur_config = AugurConfig(logger, test_db_session) def get_connection(table, cursor_field_name, connection_class, after, limit, extra_condition=False): From 4648b954907025caa25de67562daf454483526a7 Mon Sep 17 00:00:00 2001 From: Andrew Brain Date: Mon, 11 Mar 2024 18:42:05 -0500 Subject: [PATCH 2/3] add stuff --- augur/api/server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/augur/api/server.py b/augur/api/server.py index 8cbfc0718c..9d63232f88 100644 --- a/augur/api/server.py +++ b/augur/api/server.py @@ -328,7 +328,7 @@ def get_server_cache(cache_manager) -> Cache: url = get_database_string() engine = create_database_engine(url, poolclass=StaticPool) db_session = DatabaseSession(logger, engine) -augur_config = AugurConfig(logger, test_db_session) +augur_config = AugurConfig(logger, db_session) def get_connection(table, cursor_field_name, connection_class, after, limit, extra_condition=False): From ee412efec7c09496b067c19b1cc752f02af5257e Mon Sep 17 00:00:00 2001 From: Andrew Brain Date: Mon, 11 Mar 2024 18:52:17 -0500 Subject: [PATCH 3/3] Do pylint suggestion --- augur/api/server.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/augur/api/server.py b/augur/api/server.py index 9d63232f88..64a4e94bf5 100644 --- a/augur/api/server.py +++ b/augur/api/server.py @@ -28,9 +28,11 @@ from augur.application.db.session import DatabaseSession from augur.application.config import AugurConfig from augur.application.db.engine import get_database_string, create_database_engine -from metadata import __version__ as augur_code_version from augur.application.db.models import Repo, Issue, PullRequest, Message, PullRequestReview, Commit, IssueAssignee, PullRequestAssignee, PullRequestCommit, PullRequestFile, Contributor, IssueLabel, PullRequestLabel, ContributorsAlias, Release, ClientApplication +from metadata import __version__ as augur_code_version + + # from augur.api.routes import AUGUR_API_VERSION AUGUR_API_VERSION = "api/unstable"