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

Tweak to logic and more logging #78

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
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
Tweaked where we do the Informix loading
  • Loading branch information
jmgasper committed Jun 19, 2024
commit 3006cceb9ad287aa8585ae27943bcca881026d13
27 changes: 15 additions & 12 deletions src/domain/Challenge.ts
Original file line number Diff line number Diff line change
@@ -420,6 +420,21 @@ class ChallengeDomain extends CoreOperations<Challenge, CreateChallengeInput> {
}
}
}
if (
input.status === ChallengeStatuses.Completed &&
challenge.status !== ChallengeStatuses.Completed &&
!(challenge?.legacy?.pureV5Task)
) {
// Load the submission and review data from Informix into ES for caching purposes. This just makes a call to the submission
// API with a "loadLegacy=true" flag, which will force a load from Informix --> ES.
await loadInformixSubmissions(
challenge.id,
await m2mToken.getM2MToken())

}
else{
console.log(`Not loading reviews because challenge ${challenge.id} is a pure v5 task`)
}
// End Anti-Corruption Layer
} else {
// This is a Pure V5 Challenge
@@ -487,18 +502,6 @@ class ChallengeDomain extends CoreOperations<Challenge, CreateChallengeInput> {
}

generatePayments = input.paymentUpdate != null && input.paymentUpdate.payments.length > 0;

if(!(challenge?.legacy?.pureV5Task)){
// Load the submission and review data from Informix into ES for caching purposes. This just makes a call to the submission
// API with a "loadLegacy=true" flag, which will force a load from Informix --> ES.
await loadInformixSubmissions(
challenge.id,
await m2mToken.getM2MToken()
);
}
else{
console.log(`Not loading reviews because challenge ${challenge.id} is a pure v5 task`)
}
}
}