X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/734335da27f27e2177d3b931b1e5e9e8e83a042f..1e803e86b1ba69b9770192a9cf1e66edb125cf1d:/apps/workbench/app/models/pipeline_instance.rb diff --git a/apps/workbench/app/models/pipeline_instance.rb b/apps/workbench/app/models/pipeline_instance.rb index e9fa04ab6d..dd2cc0ab77 100644 --- a/apps/workbench/app/models/pipeline_instance.rb +++ b/apps/workbench/app/models/pipeline_instance.rb @@ -1,3 +1,7 @@ +# Copyright (C) The Arvados Authors. All rights reserved. +# +# SPDX-License-Identifier: AGPL-3.0 + require "arvados/keep" class PipelineInstance < ArvadosBase @@ -103,9 +107,10 @@ class PipelineInstance < ArvadosBase def stderr_log_query(limit=nil) query = Log. - where(event_type: "stderr", - object_uuid: stderr_log_object_uuids). - order("id DESC") + with_count('none'). + where(event_type: "stderr", + object_uuid: stderr_log_object_uuids). + order("created_at DESC") unless limit.nil? query = query.limit(limit) end @@ -136,6 +141,10 @@ class PipelineInstance < ArvadosBase PipelineInstanceWorkUnit.new(self, label || self.name, self.uuid) end + def cancel + arvados_api_client.api "pipeline_instances/#{self.uuid}/", "cancel", {"cascade" => true} + end + private def components_map