Skip to content

Commit

Permalink
[ML] check for empty max mml
Browse files Browse the repository at this point in the history
  • Loading branch information
darnautov committed Mar 23, 2020
1 parent cd8c140 commit 80eaeef
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions x-pack/plugins/ml/server/models/data_recognizer/data_recognizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -975,12 +975,6 @@ export class DataRecognizer {
start?: number,
end?: number
) {
const { limits } = await this.callAsCurrentUser('ml.info');

const maxMml = limits.max_model_memory_limit;
// @ts-ignore
const maxBytes: number = numeral(maxMml.toUpperCase()).value();

if (!Array.isArray(moduleConfig.jobs)) {
return;
}
Expand Down Expand Up @@ -1038,6 +1032,16 @@ export class DataRecognizer {
}
}

const { limits } = await this.callAsCurrentUser('ml.info');
const maxMml = limits.max_model_memory_limit;

if (!maxMml) {
return;
}

// @ts-ignore
const maxBytes: number = numeral(maxMml.toUpperCase()).value();

for (const job of moduleConfig.jobs) {
const mml = job.config?.analysis_limits?.model_memory_limit;
if (mml !== undefined) {
Expand Down

0 comments on commit 80eaeef

Please sign in to comment.