fix(#2635): drop obsolete todos_db/reminders_db path aliases
This commit is contained in:
parent
c316dc852d
commit
a7f0f3d231
3 changed files with 8 additions and 20 deletions
|
|
@ -482,7 +482,7 @@ async fn serve_main<S: Surface>(socket: &Path, poll_ms: u64) -> Result<()> {
|
|||
tracing::warn!(error = ?e, "legacy db_migrate failed — continuing with fresh/partial state db");
|
||||
}
|
||||
let (reminder_tx, reminder_rx) = tokio::sync::mpsc::unbounded_channel();
|
||||
let reminder_store = match reminders::Reminders::open(&paths::reminders_db()) {
|
||||
let reminder_store = match reminders::Reminders::open(&paths::state_db()) {
|
||||
Ok(store) => Some(Arc::new(store)),
|
||||
Err(e) => {
|
||||
tracing::error!(error = ?e, "open reminders db failed — reminder delivery disabled");
|
||||
|
|
@ -500,7 +500,7 @@ async fn serve_main<S: Surface>(socket: &Path, poll_ms: u64) -> Result<()> {
|
|||
// acceptable since a from-scratch harness boot either has a writable
|
||||
// harness dir or doesn't).
|
||||
let todo_wake = Arc::new(tokio::sync::Notify::new());
|
||||
match todos::Todos::open(&paths::todos_db()) {
|
||||
match todos::Todos::open(&paths::state_db()) {
|
||||
Ok(store) => {
|
||||
let store = Arc::new(store);
|
||||
let wake = todo_wake.clone();
|
||||
|
|
|
|||
|
|
@ -50,9 +50,9 @@ pub fn harness_dir() -> PathBuf {
|
|||
/// same path is safe (distinct table names, no schema collision). A
|
||||
/// questions mirror table is the planned third tenant (a following
|
||||
/// increment), not part of this schema yet.
|
||||
/// [`todos_db`] and [`reminders_db`] both resolve here — kept as separate
|
||||
/// fns (rather than every call site reading `state_db` directly) so each
|
||||
/// store's callers still say what they mean.
|
||||
/// Both the todos and reminders stores open this same path directly (see
|
||||
/// their `open()` call sites) — distinct table names mean no schema
|
||||
/// collision, so there's no need for per-store path wrapper fns here.
|
||||
///
|
||||
/// Before this consolidation, todos and reminders lived in their own
|
||||
/// `hyperhive-todos.sqlite` / `hyperhive-reminders.sqlite` files; a
|
||||
|
|
@ -63,18 +63,6 @@ pub fn state_db() -> PathBuf {
|
|||
harness_dir().join("hyperhive-state.sqlite")
|
||||
}
|
||||
|
||||
/// Harness-local todo store (loose-ends v2) path — see [`state_db`].
|
||||
#[must_use]
|
||||
pub fn todos_db() -> PathBuf {
|
||||
state_db()
|
||||
}
|
||||
|
||||
/// Harness-local reminder store path — see [`state_db`].
|
||||
#[must_use]
|
||||
pub fn reminders_db() -> PathBuf {
|
||||
state_db()
|
||||
}
|
||||
|
||||
/// Legacy pre-consolidation todos db path, consulted only by
|
||||
/// [`crate::db_migrate`] on the first boot after the upgrade.
|
||||
#[must_use]
|
||||
|
|
|
|||
|
|
@ -65,9 +65,9 @@ fn sweep_once() {
|
|||
}
|
||||
}
|
||||
|
||||
let reminders_db = crate::paths::reminders_db();
|
||||
if reminders_db.exists() {
|
||||
match vacuum_reminders(&reminders_db) {
|
||||
let state_db = crate::paths::state_db();
|
||||
if state_db.exists() {
|
||||
match vacuum_reminders(&state_db) {
|
||||
Ok(0) => {}
|
||||
Ok(n) => tracing::info!(removed = n, "reminders vacuum"),
|
||||
Err(e) => tracing::warn!(error = ?e, "reminders vacuum failed"),
|
||||
|
|
|
|||
Loading…
Reference in a new issue