Module: MaintenanceTasks
- Defined in:
- lib/maintenance_tasks.rb,
lib/maintenance_tasks/cli.rb,
lib/maintenance_tasks/engine.rb,
app/models/maintenance_tasks/run.rb,
app/models/maintenance_tasks/task.rb,
app/jobs/maintenance_tasks/task_job.rb,
app/models/maintenance_tasks/runner.rb,
app/models/maintenance_tasks/ticker.rb,
app/models/maintenance_tasks/progress.rb,
app/models/maintenance_tasks/runs_page.rb,
app/helpers/maintenance_tasks/tasks_helper.rb,
app/models/maintenance_tasks/task_data_show.rb,
app/models/maintenance_tasks/task_data_index.rb,
app/models/maintenance_tasks/application_record.rb,
lib/generators/maintenance_tasks/task_generator.rb,
app/helpers/maintenance_tasks/application_helper.rb,
app/controllers/maintenance_tasks/runs_controller.rb,
app/controllers/maintenance_tasks/tasks_controller.rb,
app/models/maintenance_tasks/no_collection_builder.rb,
lib/generators/maintenance_tasks/install_generator.rb,
app/models/maintenance_tasks/csv_collection_builder.rb,
app/jobs/concerns/maintenance_tasks/task_job_concern.rb,
app/models/maintenance_tasks/null_collection_builder.rb,
app/validators/maintenance_tasks/run_status_validator.rb,
app/controllers/maintenance_tasks/application_controller.rb,
app/models/maintenance_tasks/batch_csv_collection_builder.rb
Overview
The engine’s namespace module. It provides isolation between the host application’s code and the engine-specific code. Top-level engine constants and variables are defined under this module.
Defined Under Namespace
Modules: ApplicationHelper, Runner, TaskJobConcern, TasksHelper Classes: ApplicationController, ApplicationRecord, BatchCsvCollectionBuilder, CLI, CsvCollectionBuilder, Engine, InstallGenerator, NoCollectionBuilder, NullCollectionBuilder, Progress, Run, RunStatusValidator, RunsController, RunsPage, Task, TaskDataIndex, TaskDataShow, TaskGenerator, TaskJob, TasksController, Ticker
Class Attribute Summary collapse
-
.active_storage_service ⇒ Symbol
The Active Storage service to use for uploading CSV file blobs.
-
.backtrace_cleaner ⇒ ActiveSupport::BacktraceCleaner?
The Active Support backtrace cleaner that will be used to clean the backtrace of a Task that errors.
-
.job ⇒ String
The name of the job to be used to perform Tasks.
-
.parent_controller ⇒ String
The parent controller all web UI controllers will inherit from.
-
.report_errors_as_handled ⇒ Boolean
How unexpected errors are reported to Rails.error.report.
-
.status_reload_frequency ⇒ ActiveSupport::Duration, Numeric
The frequency at which to reload the run status during iteration.
-
.stuck_task_duration ⇒ ActiveSupport::Duration
The duration after which a task is considered stuck and can be force cancelled.
-
.tasks_module ⇒ String
The module to namespace Tasks in, as a String.
-
.ticker_delay ⇒ ActiveSupport::Duration, Numeric
The delay between updates to the tick count.
Instance Attribute Summary collapse
Class Method Summary collapse
-
.deprecator ⇒ Object
@api-private.
- .error_handler ⇒ Object deprecated Deprecated.
- .error_handler=(proc) ⇒ Object deprecated Deprecated.
Class Attribute Details
.active_storage_service ⇒ Symbol
The Active Storage service to use for uploading CSV file blobs.
52 |
# File 'lib/maintenance_tasks.rb', line 52 mattr_accessor :active_storage_service |
.backtrace_cleaner ⇒ ActiveSupport::BacktraceCleaner?
The Active Support backtrace cleaner that will be used to clean the backtrace of a Task that errors.
62 |
# File 'lib/maintenance_tasks.rb', line 62 mattr_accessor :backtrace_cleaner |
.job ⇒ String
The name of the job to be used to perform Tasks. Defaults to ‘“MaintenanceTasks::TaskJob”`. This job must be either a class that inherits from TaskJob or a class that includes TaskJobConcern.
30 |
# File 'lib/maintenance_tasks.rb', line 30 mattr_accessor :job, default: "MaintenanceTasks::TaskJob" |
.parent_controller ⇒ String
The parent controller all web UI controllers will inherit from. Must be a class that inherits from ‘ActionController::Base`. Defaults to `“ActionController::Base”`
72 |
# File 'lib/maintenance_tasks.rb', line 72 mattr_accessor :parent_controller, default: "ActionController::Base" |
.report_errors_as_handled ⇒ Boolean
How unexpected errors are reported to Rails.error.report.
When an error occurs that isn’t explicitly handled (e.g., via ‘report_on`), it gets reported to Rails.error.report. This setting determines whether these errors are marked as “handled” or “unhandled”.
The current default of ‘true` is for backwards compatibility, but it prevents error subscribers from distinguishing between expected and unexpected errors. Setting this to `false` provides more accurate error reporting and will become the default in v3.0.
110 |
# File 'lib/maintenance_tasks.rb', line 110 mattr_accessor :report_errors_as_handled, default: true |
.status_reload_frequency ⇒ ActiveSupport::Duration, Numeric
The frequency at which to reload the run status during iteration. Defaults to 1 second, meaning reload status every second.
94 |
# File 'lib/maintenance_tasks.rb', line 94 mattr_accessor :status_reload_frequency, default: 1.second |
.stuck_task_duration ⇒ ActiveSupport::Duration
The duration after which a task is considered stuck and can be force cancelled.
86 |
# File 'lib/maintenance_tasks.rb', line 86 mattr_accessor :stuck_task_duration, default: 5.minutes |
.tasks_module ⇒ String
The module to namespace Tasks in, as a String. Defaults to ‘Maintenance’.
20 |
# File 'lib/maintenance_tasks.rb', line 20 mattr_accessor :tasks_module, default: "Maintenance" |
.ticker_delay ⇒ ActiveSupport::Duration, Numeric
The delay between updates to the tick count. After each iteration, the progress of the Task may be updated. This duration in seconds limits these updates, skipping if the duration since the last update is lower than this value, except if the job is interrupted, in which case the progress will always be recorded.
43 |
# File 'lib/maintenance_tasks.rb', line 43 mattr_accessor :ticker_delay, default: 1.second |
Instance Attribute Details
#metadata ⇒ Object
79 |
# File 'lib/maintenance_tasks.rb', line 79 mattr_accessor :metadata, default: nil |
Class Method Details
.deprecator ⇒ Object
@api-private
133 134 135 |
# File 'lib/maintenance_tasks.rb', line 133 def deprecator @deprecator ||= ActiveSupport::Deprecation.new("3.0", "MaintenanceTasks") end |
.error_handler ⇒ Object
119 120 121 122 123 |
# File 'lib/maintenance_tasks.rb', line 119 def error_handler deprecator.warn(DEPRECATION_MESSAGE) @error_handler end |
.error_handler=(proc) ⇒ Object
126 127 128 129 130 |
# File 'lib/maintenance_tasks.rb', line 126 def error_handler=(proc) deprecator.warn(DEPRECATION_MESSAGE) @error_handler = proc end |