When testbox is updated, the current status is saved to the history. The "requesting" state should be skipped, because job_id is empty. It's useless to store this information.
Signed-off-by: Wu Zhende wuzhende666@163.com --- src/scheduler/elasticsearch_client.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/scheduler/elasticsearch_client.cr b/src/scheduler/elasticsearch_client.cr index e343809..91fb84a 100644 --- a/src/scheduler/elasticsearch_client.cr +++ b/src/scheduler/elasticsearch_client.cr @@ -105,7 +105,7 @@ class Elasticsearch::Client end
history ||= [] of JSON::Any - history << JSON.parse(wtmp_hash.to_json) + history << JSON.parse(wtmp_hash.to_json) unless wtmp_hash["state"]?.to_s == "requesting" history = JSON.parse(history.to_json)
body = { "history" => history}