feat(snapshot): add backend core for ZIP-based backup snapshots#1255
Merged
Conversation
Implements internal/snapshot/ per plans/snapshot-1-backend-core.md: VACUUM INTO for users.db, ZIP assembly of root/assets/branding/schema, and a Manager with async trigger, status tracking, list, and delete. No HTTP layer yet — pure business logic, covered by tests.
Align with the project convention (see internal/core/assets, internal/branding, internal/core/revision, wikiresync) instead of plain sentinel errors — snapshot_already_running, snapshot_not_found, snapshot_invalid_id, snapshot_list_failed, snapshot_delete_failed.
…ck lint Set a busy_timeout pragma on the VACUUM INTO connection so a snapshot taken while an admin write (user create/update/delete) is in flight waits the writer out instead of failing immediately with SQLITE_BUSY. Covered by a test that holds an exclusive lock during the vacuum call. Also wraps deferred Close()/RemoveAll() calls to discard their errors explicitly, matching the rest of the codebase's errcheck-clean style.
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.
No description provided.