Skip to content

Stored Favorite / Membership Counts#601

Merged
julianweng merged 12 commits into
masterfrom
stored_favorite_membership_counts
Feb 2, 2024
Merged

Stored Favorite / Membership Counts#601
julianweng merged 12 commits into
masterfrom
stored_favorite_membership_counts

Conversation

@shiva-menta

Copy link
Copy Markdown

PR to cache favorite / membership counts for clubs. The alternative is recalculating this for every query.

@shiva-menta shiva-menta requested a review from rm03 November 5, 2023 18:57
Comment thread k8s/main.ts Outdated
schedule: cronTime.everyDayAt(12),
image: backendImage,
secret: fyhSecret,
cmd: ["python", "manage.py", "import_paideia_events"],

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

should be update_club_counts

)
except Exception as e:
self.stdout.write(
self.style.SUCCESS(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

self.style.ERROR(...)

Comment thread backend/pennclubs/settings/base.py Outdated
BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))

# Django Setting Environment Variable
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pennclubs.settings.base")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why do we need this?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Not entirely sure honestly I think I may have added it on accident. Removing.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Oh never mind I needed that to run the test cases for some reason, won't include it in PR though.

for club in queryset:
club.favorite_count = club.temp_favorite_count
club.membership_count = club.temp_membership_count
club.save()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

consider using bulk_update()

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Yup good call.

@rohangpta

Copy link
Copy Markdown
Member

Could be an interesting exercise to upgrade to 5.0 and also update related deps (which will include upgrading the Python version which has a host of its own benefits), so that we can take advantage of this. Wdyt?

@rm03 rm03 mentioned this pull request Jan 22, 2024
@rm03 rm03 marked this pull request as ready for review January 31, 2024 23:38
@gitguardian

gitguardian Bot commented Feb 2, 2024

Copy link
Copy Markdown

⚠️ GitGuardian has uncovered 5 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
- Generic Password e3e4e01 docker-compose.test.yaml View secret
- Generic Password 8b08062 docker-compose.test.yaml View secret
- Generic Password 8b08062 docker-compose.test.yaml View secret
- Generic Password e3e4e01 docker-compose.test.yaml View secret
9451515 Triggered Generic Password e28f1e9 backend/docker-compose.yaml View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Our GitHub checks need improvements? Share your feedbacks!

@julianweng julianweng merged commit fc28c42 into master Feb 2, 2024
@julianweng julianweng deleted the stored_favorite_membership_counts branch February 2, 2024 23:02
@joyliu-q joyliu-q restored the stored_favorite_membership_counts branch February 3, 2024 00:08
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.

4 participants