class ExecutionHistoriesController
Global log of operations. The per-table history stays in iceberg_tables#show; this screen answers โwhat happened recentlyโ โ the maintenance executions.
Constants
- PAGE_SIZE
Public Instance Methods
Source
# File app/controllers/execution_histories_controller.rb, line 30 def cancel authorize @execution, :cancel? status = @execution.status == "pending" ? :skipped : :failed @execution.update!(status: status, error_message: "cancelled by operator", finished_at: Time.current) TableLock.release(@execution) TrinoEngineSupervisor.demand_finished! redirect_to activity_path, notice: t("activity.notices.cancelled") end
Operator cancellation of an execution: mark it failed (running) or skipped (pending, never ran), free the table lock and let the supervisor decide about the engine.
Source
# File app/controllers/execution_histories_controller.rb, line 9 def index authorize ExecutionHistory @catalogs = Catalog.order(:name) filters = params.permit(:catalog_id, :table_id, :status, :operation, :stopped_at_step, :page) timeline = OperationTimeline.new( catalog_id: filters[:catalog_id].to_s.presence, table_id: filters[:table_id].to_s.presence, status: filters[:status].to_s.presence, operation: filters[:operation].to_s.presence, stopped_at_step: filters[:stopped_at_step].to_s.presence ) @pagy, @rows = pagy(timeline.collection, limit: PAGE_SIZE) @rows = @rows.map(&:symbolize_keys) load_records(@rows) end
Lists the timeline of executions, newest first.