Skip to content

Commit

Permalink
Merge pull request #1677 from Expensify/dan-crash-on-corruption
Browse files Browse the repository at this point in the history
Crash immediately when detecting corruption.
  • Loading branch information
grgia authored Mar 18, 2024
2 parents 269829f + d0ddb80 commit 59487d4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libstuff/libstuff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2641,6 +2641,10 @@ int SQuery(sqlite3* db, const char* e, const string& sql, SQResult& result, int6
}
}

if (error == SQLITE_CORRUPT) {
SERROR("Database corruption was detected, cannot continue, bedrock will exit immediately.");
}

uint64_t elapsed = STimeNow() - startTime;
if ((int64_t)elapsed > warnThreshold || (int64_t)elapsed > 10000) {
// Avoid logging queries so long that we need dozens of lines to log them.
Expand Down

0 comments on commit 59487d4

Please sign in to comment.