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

reduce calls to jira issue status #2610

Merged
merged 3 commits into from
Dec 12, 2023

Conversation

gxueatlassian
Copy link
Contributor

What's in this PR?

  1. Reduce times to called to jira issue status
  2. Add redis cache timeout ff

Why

Added feature flags
skip-process-queue-when-issue-not-exists-timeout

Affected issues
None

How has this been tested?
Unit test.

Whats Next?

@gxueatlassian gxueatlassian requested a review from a team as a code owner December 12, 2023 04:37
const commitPromises: Promise<JiraCommit | null>[] = recentShas.map(async (sha): Promise<JiraCommit | null> => {
try {

if (await booleanFlag(BooleanFlags.SKIP_PROCESS_QUEUE_IF_ISSUE_NOT_FOUND, jiraHost)) {
if (!await someIssueKeysExistsOnJira(subscription.jiraHost, sha.issueKeys, jiraClient, log)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current problem is, this api calls are fired in parallel because we are using

await Promise.all(recentShas.map(sha=>Promise()))

So even for same jira issue, there's no time for redis to cache the result.

@gxueatlassian gxueatlassian merged commit 7248cb3 into main Dec 12, 2023
4 of 5 checks passed
@gxueatlassian gxueatlassian deleted the NONE-improve-jira-issue-status-fetching branch December 12, 2023 05:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants