Merge development into production - #476
Merged
Merged
Conversation
- Treat each avatar's medium and small variants as referenced; only the original path is stored, so a live run deleted in-use variants. - Scan upload directories recursively so files left in retired layouts (the old expedition logos/original and logos/medium) are found. - Skip hidden placeholder files such as .gitkeep. - Use a keyed lookup for referenced paths and return an exit code. - Fail with an incomplete-results message when a directory cannot be listed or a file cannot be deleted, instead of reporting 0 orphans. Closes #464
Rework files:cleanup-orphaned for current upload layouts
Attaching or detaching subjects loaded and saved each subject one at a
time: two round trips per subject, about 36 seconds for 20,000 subjects
locally. Use chunked $addToSet/$pull updates instead (about 1.2 seconds
for 20,000).
- SubjectService: bulk attachSubjects()/detachSubjects() in chunks of
1,000, plus getIdsByExpeditionId() and countByExpeditionId().
- ExpeditionService: store()/update() write MySQL only; saveSubjects()
applies the selection afterwards and sets the stat and actor totals
from the MongoDB count. The MongoDB rollback code is removed; the
updates are idempotent, so a failed save is fixed by resubmitting.
- ExpeditionController: if subjects fail to save, the expedition stays
saved and the user is sent to edit and resubmit. New-expedition
notifications are sent after subjects save.
- ExpeditionFormRequest: validate subject-ids against
config('config.expedition_size').
Closes #332
Save expedition subjects with bulk MongoDB updates Fixes #332
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Included
$addToSet/$pullupdates instead of onefind()+save()per subject.subject-idsis validated against the 20,000 limit.files:cleanup-orphanedfor current upload layouts (closes Cleanup CleanupOrphanedS3UploadFiles #464).gitkeepfiles are skipped; listing or delete errors fail the command instead of reporting 0 orphans.Deployment
update_queries_operationis'').subjectsalready usesimageId(noidfield), which this release relies on.php artisan files:cleanup-orphaned --dry-runshould list onlyuploads/projects/logos/1761087456_badge1.png.Validation