Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DEV-5042] Optimize /filter/jira cache performance #2845

Merged
merged 1 commit into from Sep 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 7 additions & 5 deletions server/athenian/api/controllers/jira_controller.py
Expand Up @@ -3,7 +3,6 @@
from datetime import datetime, timedelta, timezone
from itertools import chain
import logging
import pickle
from typing import Any, Collection, Mapping, Optional, Type, Union

from aiohttp import web
Expand Down Expand Up @@ -91,6 +90,7 @@
JIRAUser,
PullRequest as WebPullRequest,
)
from athenian.api.models.web_model_io import deserialize_models, serialize_models
from athenian.api.request import AthenianWebRequest
from athenian.api.response import ResponseError, model_response
from athenian.api.tracing import sentry_span
Expand Down Expand Up @@ -224,8 +224,8 @@ async def filter_jira_stuff(request: AthenianWebRequest, body: dict) -> web.Resp
@sentry_span
@cached(
exptime=short_term_exptime,
serialize=pickle.dumps,
deserialize=pickle.loads,
serialize=serialize_models,
deserialize=deserialize_models,
key=lambda return_, time_from, time_to, exclude_inactive, label_filter, priorities, reporters, assignees, commenters, default_branches, release_settings, logical_settings, **_: ( # noqa
JIRAFilterReturn.EPICS in return_,
JIRAFilterReturn.PRIORITIES in return_,
Expand All @@ -242,6 +242,7 @@ async def filter_jira_stuff(request: AthenianWebRequest, body: dict) -> web.Resp
release_settings,
logical_settings,
),
version=2,
)
async def _epic_flow(
return_: set[str],
Expand Down Expand Up @@ -548,8 +549,8 @@ async def _epic_flow(
@sentry_span
@cached(
exptime=short_term_exptime,
serialize=pickle.dumps,
deserialize=pickle.loads,
serialize=serialize_models,
deserialize=deserialize_models,
key=lambda return_, time_from, time_to, exclude_inactive, label_filter, priorities, reporters, assignees, commenters, default_branches, release_settings, logical_settings, **_: ( # noqa
JIRAFilterReturn.ISSUES in return_,
JIRAFilterReturn.ISSUE_BODIES in return_,
Expand All @@ -571,6 +572,7 @@ async def _epic_flow(
release_settings,
logical_settings,
),
version=2,
)
async def _issue_flow(
return_: set[str],
Expand Down