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

Feat/refactor polling #8976

Merged
merged 2 commits into from
Dec 13, 2024
Merged

Feat/refactor polling #8976

merged 2 commits into from
Dec 13, 2024

Conversation

FredrikOseberg
Copy link
Contributor

This PR refactors the method that listens on revision changes:

  • Now supports all environments
  • Removed unnecessary populate cache method

Discussion point

In the listen method, should we implement logic to look into which environments the events touched? By doing this we would:

  • Reduce cache size
  • Save some memory/CPU if the environment is not initialized in the cache, because we could skip the DB calls.

Copy link

vercel bot commented Dec 13, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
unleash-docs ⬜️ Ignored (Inspect) Dec 13, 2024 8:14am
unleash-monorepo-frontend ⬜️ Ignored (Inspect) Dec 13, 2024 8:14am

Copy link
Contributor

@FredrikOseberg, core features have been modified in this pull request. Please review carefully!

Copy link
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Files

];
const newToggles = await this.getChangedToggles(
changedToggles,
latestRevision, // TODO: this should come back from the same query to not be out of sync
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks ok, but I was thinking about if we might not want to return the revisionId, from query .

Because the flow is getMaxRevisionId(), based on which we get the events, and if now with those events, go pull data and revision ID has changed, it will get out sync. I think best is

If we getMaxRevisionId, we use that across all the calls we make.

@sjaanus sjaanus merged commit b2cf0e4 into main Dec 13, 2024
10 checks passed
@sjaanus sjaanus deleted the feat/refactor-polling branch December 13, 2024 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants