Skip to content

Commit

Permalink
Add debug for 'PRAGMA cipher_migrate'
Browse files Browse the repository at this point in the history
GitOrigin-RevId: 69c9a979ccf27f77d106e6ce7712c6e4a939722c
  • Loading branch information
arseny30 committed Aug 13, 2020
1 parent d4f0162 commit cecea2b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tddb/td/db/SqliteDb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,10 @@ Result<SqliteDb> SqliteDb::do_open_with_key(CSlice path, const DbKey &db_key, bo
auto key = db_key_to_sqlcipher_key(db_key);
TRY_STATUS(db.exec(PSLICE() << "PRAGMA key = " << key));
if (with_cipher_migrate) {
LOG(INFO) << "Start 'PRAGMA cipher_migrate' for " << path;
PerfWarningTimer timer("PRAGMA cipher_migrate", 0.5);
TRY_RESULT(code, db.get_pragma_string("cipher_migrate"));
LOG(INFO) << "Finish 'PRAGMA cipher_migrate' for " << path;
if (code != "0") {
return Status::Error(PSLICE() << "'PRAGMA cipher_migrate' failed - " << code);
}
Expand Down

0 comments on commit cecea2b

Please sign in to comment.