X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/adfe146695a6acebe65b7953db1e8a88dc53a6b4..068e72307f9ce91538e45cb461b99cf92d2f5666:/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 62bbc54319..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 @@ -133,7 +138,11 @@ class PipelineInstance < ArvadosBase end def work_unit(label=nil) - PipelineInstanceWorkUnit.new(self, label || self.name) + PipelineInstanceWorkUnit.new(self, label || self.name, self.uuid) + end + + def cancel + arvados_api_client.api "pipeline_instances/#{self.uuid}/", "cancel", {"cascade" => true} end private