Check whether lox_db is empty after recovering

This commit is contained in:
Cecylia Bocovich 2023-11-20 15:28:25 -05:00
parent d8e40b53c4
commit 5ed62d239d
No known key found for this signature in database
GPG Key ID: 009DE379FD9B7B90
1 changed files with 1 additions and 1 deletions

View File

@ -51,7 +51,7 @@ impl DB {
let (lox_db, context) = match sled::open(db_config.db_path) {
Ok(lox_db) => {
// Check if the lox_db already exists
if lox_db.was_recovered() {
if lox_db.was_recovered() && !lox_db.is_empty() {
context = read_lox_context_from_db(lox_db.clone(), roll_back_date);
context.metrics = metrics;
//Otherwise, create a new Lox context