Class: GoodData::Bricks::ExecutionResultMiddleware
- Inherits:
-
Middleware
- Object
- Middleware
- GoodData::Bricks::ExecutionResultMiddleware
- Defined in:
- lib/gooddata/bricks/middleware/execution_result_middleware.rb
Constant Summary collapse
- @@result_log_path =
nil
Instance Attribute Summary
Attributes inherited from Middleware
Class Method Summary collapse
-
.update_execution_result(status, message = "") ⇒ Object
Update process execution result when the script is executed inside a GDC ETL process execution (ruby bricks).
Instance Method Summary collapse
Methods inherited from Middleware
Methods included from Utils
Constructor Details
This class inherits a constructor from GoodData::Bricks::Middleware
Class Method Details
.update_execution_result(status, message = "") ⇒ Object
Update process execution result when the script is executed inside a GDC ETL process execution (ruby bricks). Ruby bricks should update execution result at the end of script with status=WARNING or OK and summary message if the script exits normally. If any fatal error, script should update execution result with status=ERROR and error message, then throw exception to notify GDC platform that the script terminated unexpectedly.
31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/gooddata/bricks/middleware/execution_result_middleware.rb', line 31 def self.update_execution_result(status, = "") if status != ExecutionStatus::OK && status != ExecutionStatus::ERROR && status != ExecutionStatus::WARNING GoodData.logger.warn("Unknown execution status #{status}, ignored it.") end result = { executionResult: { status: status, message: } } update_result(result, status) end |
Instance Method Details
#call(params) ⇒ Object
19 20 21 22 |
# File 'lib/gooddata/bricks/middleware/execution_result_middleware.rb', line 19 def call(params) result_log_path(params) @app.call(params) end |