[mob][photos] Extra safety checks for hooking MLController
This commit is contained in:
parent
48e78d170d
commit
b2c274e73b
1 changed files with 7 additions and 3 deletions
|
@ -257,7 +257,7 @@ class FaceMlService {
|
|||
return _functionLock.synchronized(() async {
|
||||
_resetInactivityTimer();
|
||||
|
||||
if (isImageIndexRunning == false) {
|
||||
if (isImageIndexRunning == false || MachineLearningController.instance.canRunML == false) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -1339,8 +1339,12 @@ class FaceMlService {
|
|||
/// Checks if the ente file to be analyzed actually can be analyzed: it must be uploaded and in the correct format.
|
||||
void _checkEnteFileForID(EnteFile enteFile) {
|
||||
if (_skipAnalysisEnteFile(enteFile, <int, int>{})) {
|
||||
_logger.severe(
|
||||
"Skipped analysis of image with enteFile ${enteFile.toString()} because it is the wrong format or has no uploadedFileID",
|
||||
_logger.warning(
|
||||
'''Skipped analysis of image with enteFile, it might be the wrong format or has no uploadedFileID, or MLController doesn't allow it to run.
|
||||
enteFile: ${enteFile.toString()}
|
||||
isImageIndexRunning: $isImageIndexRunning
|
||||
canRunML: ${MachineLearningController.instance.canRunML}
|
||||
''',
|
||||
);
|
||||
throw CouldNotRetrieveAnyFileData();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue