Fix task and model last_change handling

Improve db model index
Improve db model infrastructure
This commit is contained in:
allegroai
2021-01-05 18:17:29 +02:00
parent 29c792d459
commit 59994ccf9c
14 changed files with 80 additions and 35 deletions

View File

@@ -155,6 +155,8 @@ class Task(AttributedDocument):
"project",
("company", "name"),
("company", "user"),
("company", "status", "type"),
("company", "system_tags", "last_update"),
("company", "type", "system_tags", "status"),
("company", "project", "type", "system_tags", "status"),
("status", "last_update"), # for maintenance tasks
@@ -215,6 +217,7 @@ class Task(AttributedDocument):
last_worker = StringField()
last_worker_report = DateTimeField()
last_update = DateTimeField()
last_change = DateTimeField()
last_iteration = IntField(default=DEFAULT_LAST_ITERATION)
last_metrics = SafeMapField(field=SafeMapField(EmbeddedDocumentField(MetricEvent)))
metric_stats = SafeMapField(field=EmbeddedDocumentField(MetricEventStats))