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: clear expired gifted plus subscription #2604

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

ilasw
Copy link
Contributor

@ilasw ilasw commented Jan 18, 2025

  • add new cron for cleaning expired gifted plus subscription;
  • add test case

@ilasw ilasw changed the title feat: clear gifted plus subscription feat: clear expired gifted plus subscription Jan 18, 2025
Copy link
Contributor

@capJavert capJavert left a comment

Choose a reason for hiding this comment

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

Few things missed, overall looks good 👍

src/cron/cleanGiftedPlus.ts Outdated Show resolved Hide resolved
src/cron/cleanGiftedPlus.ts Outdated Show resolved Hide resolved
__tests__/cron/cleanGiftedPlus.ts Outdated Show resolved Hide resolved
src/entity/user/User.ts Outdated Show resolved Hide resolved
src/cron/index.ts Show resolved Hide resolved
__tests__/cron/cleanGiftedPlus.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@rebelchris rebelchris left a comment

Choose a reason for hiding this comment

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

Nothing besides Ante's comments

src/cron/cleanGiftedPlus.ts Outdated Show resolved Hide resolved
@ilasw ilasw requested review from capJavert and rebelchris January 22, 2025 15:39
Copy link
Contributor

@capJavert capJavert left a comment

Choose a reason for hiding this comment

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

Minor suggestions, but good to go after that.

.createQueryBuilder('user')
.update()
.set({ subscriptionFlags: {} })
.where('"user"."subscriptionFlags" ->> \'giftExpirationDate\' < :time', {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
.where('"user"."subscriptionFlags" ->> \'giftExpirationDate\' < :time', {
.where(`"user"."subscriptionFlags"->>'giftExpirationDate' < :time`, {

.infra/crons.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@rebelchris rebelchris left a comment

Choose a reason for hiding this comment

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

Nothing besides Ante's comment.

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.

3 participants