Skip to content

Commit

Permalink
Merge pull request #1700 from Expensify/main
Browse files Browse the repository at this point in the history
Update expensify_prod branch
  • Loading branch information
iwiznia committed Apr 17, 2024
2 parents 147e6e3 + 28e6573 commit 36b56dd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion BedrockCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ void BedrockCore::prePeekCommand(unique_ptr<BedrockCommand>& command) {
}

BedrockCore::RESULT BedrockCore::peekCommand(unique_ptr<BedrockCommand>& command, bool exclusive) {
AutoTimer timer(command, exclusive ? BedrockCommand::BLOCKING_PEEK : BedrockCommand::PEEK);
BedrockServer::ScopedStateSnapshot snapshot(_server);
command->lastPeekedOrProcessedInState = _server.getState();

Expand All @@ -146,6 +145,9 @@ BedrockCore::RESULT BedrockCore::peekCommand(unique_ptr<BedrockCommand>& command
STHROW("501 Failed to begin " + (exclusive ? "exclusive"s : "shared"s) + " transaction");
}

// We start the timer here to avoid including the time spent acquiring the lock _sharedData.commitLock
AutoTimer timer(command, exclusive ? BedrockCommand::BLOCKING_PEEK : BedrockCommand::PEEK);

// Make sure no writes happen while in peek command
_db.setQueryOnly(true);

Expand Down

0 comments on commit 36b56dd

Please sign in to comment.