Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display database path with ticks error. #127

Open
noyez opened this issue Mar 2, 2023 · 1 comment
Open

Display database path with ticks error. #127

noyez opened this issue Mar 2, 2023 · 1 comment

Comments

@noyez
Copy link
Contributor

noyez commented Mar 2, 2023

I ran across issue #126 and became puzzled as to where the database existed. I added a line of code which displays the location of the database when this error occurs. There might be a better way to display this value, however i thought it might be useful to signal to the user where the database lived.

diff --git a/src/main.rs b/src/main.rs
index fd3770c..c8c526e 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -82,7 +82,8 @@ fn use_db_history(db_path: &Path, tick_rate: u64) -> Option<bool> {
         let tick = Duration::from_millis(tick_rate);
         if map.tick != tick {
             println!(
-                "Database tick: {} does not match supplied tick: {}.",
+                "Using Database:{:?}\nDatabase tick: {} does not match supplied tick: {}.",
+                db_path,
                 map.tick.as_millis(),
                 tick.as_millis()
             );

example output:

Using Database:"/home/b/.cache/zenith/store"
Database tick: 0 does not match supplied tick: 2000.
Proceed with (D)atabase tick: 0, (S)upplied tick with history disabled: 2000, (E)xit?:
@bvaisvil
Copy link
Owner

bvaisvil commented Mar 2, 2023

That would be helpful. Happy to accept a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants