-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
Convert to MongoDB callback API #184
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @Enkidu93 and @johnml1135)
src/SIL.Machine.AspNetCore/Services/NmtEngineService.cs
line 59 at r1 (raw file):
IsModelPersisted = isModelPersisted ?? false // models are not persisted if not specified }; await _engines.InsertAsync(translationEngine, cancellationToken);
You should use ct
just to be safe.
src/SIL.Machine.AspNetCore/Services/SmtTransferEngineService.cs
line 57 at r1 (raw file):
IsModelPersisted = isModelPersisted ?? true // models are persisted if not specified }; await _engines.InsertAsync(translationEngine, cancellationToken);
You should use ct
to be safe.
src/SIL.Machine.AspNetCore/Services/SmtTransferEngineService.cs
line 83 at r1 (raw file):
async (ct) => { await _engines.DeleteAsync(e => e.EngineId == engineId, cancellationToken);
You should use ct
to be safe.
src/SIL.Machine.AspNetCore/Services/SmtTransferEngineService.cs
line 157 at r1 (raw file):
} SmtTransferEngineState state;
You should be able to set the state here, i.e. SmtTransferEngineState state = _stateService.Get(engineId);
, and pass the state to the TrainSubroutineAsync
call.
src/SIL.Machine.AspNetCore/Services/SmtTransferEngineService.cs
line 175 at r1 (raw file):
return await TrainSubroutineAsync(); }, cancellationToken: cancellationToken
I don't think we should make this transaction cancelable, i.e. we should pass in CancellationToken.None
. Once hybridEngine.TrainSegmentAsync
has been called, we don't want to be able to cancel the request, since the SMT model has been updated on the disk.
Previously, ddaspit (Damien Daspit) wrote…
Done |
Previously, ddaspit (Damien Daspit) wrote…
done |
Previously, ddaspit (Damien Daspit) wrote…
It't a bit cleaner - ok. |
Previously, ddaspit (Damien Daspit) wrote…
Is that better? |
Previously, ddaspit (Damien Daspit) wrote…
ok |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 2 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Enkidu93 and @johnml1135)
src/SIL.Machine.AspNetCore/Services/SmtTransferEngineService.cs
line 172 at r2 (raw file):
); await TrainSubroutineAsync(state, ct); return;
The return
is unnecessary.
Previously, ddaspit (Damien Daspit) wrote…
You're right. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r3, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @Enkidu93)
3dce802
to
5e2650d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @Enkidu93)
5e2650d
to
8450c20
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #184 +/- ##
=======================================
Coverage 67.09% 67.10%
=======================================
Files 441 441
Lines 34826 34849 +23
Branches 4669 4668 -1
=======================================
+ Hits 23368 23386 +18
- Misses 10365 10370 +5
Partials 1093 1093 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r5, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @Enkidu93)
sillsdev/serval#314
This should help fix the transaction issues the right way.
This change is