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

Update expensify_prod branch #1685

Merged
merged 5 commits into from
Mar 26, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add comment, format code
  • Loading branch information
iwiznia committed Mar 25, 2024
commit 2570e65ff00cd580b430618954b0ae5f7cf68d40
6 changes: 4 additions & 2 deletions plugins/Jobs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,13 +296,15 @@ bool BedrockJobsCommand::peek(SQLite& db) {

// If there's no job or the existing job doesn't match the data we've been passed, escalate to leader.
if (!result.empty()) {
// If the parent passed does not much the parent the job already had, then it must mean we did something
// wrong or made a bad CQ, so we throw so we can investigate. Updating the parent here would be
// confusing, as it could leave the original parent in a bad state (like for example paused forever)
if (result[0][2] != "0" && result[0][2] != job["parentJobID"]) {
STHROW("404 Trying to create a child that already exists, but it is tied to a different parent");
}
if (SIEquals(requestVerb, "CreateJob") && ((job["data"].empty() && result[0][1] == "{}") || (!job["data"].empty() && result[0][1] == job["data"]))) {
// Return early, no need to pass to leader, there are no more jobs to create.
SINFO("Job already existed and unique flag was passed, reusing existing job " << result[0][0] << ", mocked? "
<< (mockRequest ? "true" : "false"));
SINFO("Job already existed and unique flag was passed, reusing existing job " << result[0][0] << ", mocked? " << (mockRequest ? "true" : "false"));
jsonContent["jobID"] = result[0][0];
return true;
}
Expand Down