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

Adding /feeds/delayed route to Posts service, adding test in posts/te… #2575

Merged
merged 1 commit into from
Dec 10, 2021

Conversation

hphan9
Copy link
Contributor

@hphan9 hphan9 commented Dec 7, 2021

…st/feeds.test.js, fixing the setDelayedFeeds function in posts/src/storage.js and backend/utils/storage.js

Issue This PR Addresses

Fixes #2413

Type of Change

  • Bugfix: Change which fixes an issue
  • New Feature: Change which adds functionality
  • Documentation Update: Change which improves documentation
  • UI: Change which improves UI

Description

I added a new route /feeds/delayed to Posts service. I also fixed the small bug in the setDelayedFeed function to set a time for expiry in seconds. Thank you and please review my pull request.

Checklist

  • Quality: This PR builds and passes our npm test and works locally
  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Screenshots: This PR includes screenshots or GIFs of the changes made or an explanation of why it does not (if applicable)
  • Documentation: This PR includes updated/added documentation to user exposed functionality or configuration variables are added/changed or an explanation of why it does not(if applicable)

@gitpod-io
Copy link

gitpod-io bot commented Dec 7, 2021

Copy link
Contributor

@humphd humphd left a comment

Choose a reason for hiding this comment

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

Looks great, one question.

const delayedKeys = await getFeedKeysUsingScanStream(`${feedNamespace}*${delayedSuffix}`);
return Promise.all(
delayedKeys.map(async (key) => {
const timeLeft = await redis.ttl(key);
Copy link
Contributor

Choose a reason for hiding this comment

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

I can't decide if we need this info or not. The fact that it will require so many extra async calls to Redis makes me want to say that we don't. Just knowing that it's delayed is probably enough? What's your thinking?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I think we should not have this timeLeft infor. we don't use it for anything. I will remove it and fix the test. Thank you :)

humphd
humphd previously approved these changes Dec 9, 2021
@humphd
Copy link
Contributor

humphd commented Dec 9, 2021

@hphan9 please squash and rebase this.

* Adding functions in posts/src/route/feeds.js, adding test in posts/test/feeds.test.js, fixing the setDelayedFeeds function in posts/src/storage.js and backend/utils/storage.js

* removing timeLeft infor in getDelayedFeeds
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.

Add /feeds/delayed route to Posts service
3 participants