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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user