MDL-64996 analytics: Don't mark static model as untrained after clearing

Static predictions models (i.e. those using a target based on
assumptions, not facts) are always considered as trained. Clearing them
must not mark them as untrained. Doing so would make them being skipped
by the prediction scheduled task.
This commit is contained in:
David Mudrák
2019-03-25 08:56:11 +01:00
parent 3271c39c74
commit c679d39c36
2 changed files with 28 additions and 1 deletions
+4 -1
View File
@@ -1626,7 +1626,10 @@ class model {
// 1 db read per context.
$this->purge_insights_cache();
$this->model->trained = 0;
if (!$this->is_static()) {
$this->model->trained = 0;
}
$this->model->timemodified = time();
$this->model->usermodified = $USER->id;
$DB->update_record('analytics_models', $this->model);