Skip to content

Prevent the while loop to be executing too long#1073

Merged
themarolt merged 1 commit intomainfrom
bugfix/job-check-stuck-int-runs-fix
Jul 4, 2023
Merged

Prevent the while loop to be executing too long#1073
themarolt merged 1 commit intomainfrom
bugfix/job-check-stuck-int-runs-fix

Conversation

@themarolt
Copy link
Copy Markdown
Contributor

@themarolt themarolt commented Jul 4, 2023

Changes proposed ✍️

What

🤖 Generated by Copilot at e2ef40f

Add pagination support to getIntegrationRuns function in integrationRunRepository.ts. This allows fetching integration runs by batches based on their creation date.

🤖 Generated by Copilot at e2ef40f

Sing, O Muse, of the skillful coder who devised
A clever way to paginate the getIntegrationRuns
By filtering them by date, with a dynamic query
That used the lastCreatedAt as a boundary

Why

Because the rows are not always changed the results are most of the times the same so the while loops loops almost for ever.

How

🤖 Generated by Copilot at e2ef40f

  • Add lastCreatedAt parameter to getIntegrationRuns function to filter integration runs by maximum creation date (link)
  • Build dynamic condition string based on lastCreatedAt parameter and append it to existing where clause with and operator (link)
  • Include condition string in SQL query in where clause in backend/src/database/repositories/integrationRunRepository.ts (link)

Checklist ✅

  • Label appropriately with Feature, Improvement, or Bug.
  • Add screehshots to the PR description for relevant FE changes
  • New backend functionality has been unit-tested.
  • API documentation has been updated (if necessary) (see docs on API documentation).
  • Quality standards are met.

@themarolt themarolt added the Bug Created by Linear-GitHub Sync label Jul 4, 2023
@themarolt themarolt merged commit 3db61b4 into main Jul 4, 2023
@themarolt themarolt deleted the bugfix/job-check-stuck-int-runs-fix branch July 4, 2023 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Created by Linear-GitHub Sync

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant