aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/__init__.py
diff options
context:
space:
mode:
authorGravatar Johannes Christ <[email protected]>2021-07-11 22:56:17 +0200
committerGravatar Johannes Christ <[email protected]>2021-07-11 23:04:49 +0200
commitc52c606e6ae09291378c6eae17938d642dc2e463 (patch)
tree8c4ad3e710a3576dc414aba34cb59e6365b12c8f /pydis_site/__init__.py
parentMerge pull request #552 from python-discord/cj/minor-adjustments (diff)
Improvements & fixes to homepage repository display.
These changes mainly aim to prevent multiple concurrent requests from deadlocking the table due to the lazy evaluation imposed by `objects.all()`, and introduce some quality of life changes whilst doing so. To prevent unwanted locks, the following is done: - Instead of evaluating the first item of `objects.all()` only in order to determine when the table was most recently updated, we query for the least recent updated entry and use that instead. As we use `.first()`, the model instance is loaded directly. The following quality of life changes are introduced: - Instead of manual "update or create" logic for repositories retrieved from the API, use Django's `update_or_create` instead. - Instead of manual bulk creation of entries on initial data retrieve, Django's `bulk_create` method is used instead. - To allow for local testing of this endpoint without having to manually set up GitHub REST authorization, anonymous GitHub access is used when no `GITHUB_TOKEN` is configured.
Diffstat (limited to 'pydis_site/__init__.py')
0 files changed, 0 insertions, 0 deletions