mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[PR #6137] [MERGED] fix(database): create SQLite backup snapshots online #6100
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#6100
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/MHSanaei/3x-ui/pull/6137
Author: @PathGao
Created: 7/29/2026
Status: ✅ Merged
Merged: 7/29/2026
Merged by: @MHSanaei
Base:
main← Head:fix-sqlite-backup-snapshot-v2📝 Commits (5)
ee316a2fix(database): snapshot SQLite backups onlinea771784style(database): group SQLite driver imports3e8abe7fix(database): bound online backup retriese2b1c74test(database): cover existing backup destinationsa348c9dfix(database): harden SQLite snapshot lifecycle📊 Changes
6 files changed (+334 additions, -70 deletions)
View changed files
📝
go.mod(+1 -1)➕
internal/database/backup_test.go(+186 -0)📝
internal/database/db.go(+113 -5)📝
internal/database/journal_mode_test.go(+0 -41)📝
internal/web/service/server.go(+18 -16)📝
internal/web/service/tgbot/tgbot_report.go(+16 -7)📄 Description
Problem
SQLite downloads and SQLite migration exports previously ran a WAL checkpoint and then read the live database file. A commit between those operations could produce a copy that does not represent a single SQLite state.
Change
Regression coverage
Validated locally with
go test -race -shuffle=on -count=1 ./internal/database ./internal/web/service/tgbot,go vetfor those packages, andgolangci-lint run.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.