X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/0066dc77abc461090fe98bcee7c6e324a5ca43a1..2e26522a30b1bb866be81b1013e3329b4d21ed6e:/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