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

Instance Attribute Summary collapse

Class Attribute Details

.active_storage_serviceSymbol

The Active Storage service to use for uploading CSV file blobs.

Returns:

  • (Symbol)

    the key for the storage service, as specified in the app’s config/storage.yml.



54
# File 'lib/maintenance_tasks.rb', line 54

mattr_accessor :active_storage_service

.backtrace_cleanerActiveSupport::BacktraceCleaner?

The Active Support backtrace cleaner that will be used to clean the backtrace of a Task that errors.

Returns:

  • (ActiveSupport::BacktraceCleaner, nil)

    the backtrace cleaner to use when cleaning a Run’s backtrace.



64
# File 'lib/maintenance_tasks.rb', line 64

mattr_accessor :backtrace_cleaner

.error_handlerProc

The callback to perform when an error occurs in the Task. See the README for details.

Returns:

  • (Proc)

    the callback to perform when an error occurs in the Task.



73
74
# File 'lib/maintenance_tasks.rb', line 73

mattr_accessor :error_handler, default:
->(_error, _task_context, _errored_element) {}

.jobString

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.

Returns:

  • (String)

    the name of the job class.



32
# File 'lib/maintenance_tasks.rb', line 32

mattr_accessor :job, default: "MaintenanceTasks::TaskJob"

.parent_controllerString

The parent controller all web UI controllers will inherit from. Must be a class that inherits from ‘ActionController::Base`. Defaults to `“ActionController::Base”`

Returns:

  • (String)

    the name of the parent controller for web UI.



84
# File 'lib/maintenance_tasks.rb', line 84

mattr_accessor :parent_controller, default: "ActionController::Base"

.stuck_task_durationActiveSupport::Duration

The duration after which a task is considered stuck and can be force cancelled.

Returns:

  • (ActiveSupport::Duration)

    the threshold in seconds after which a task is considered stuck.



98
# File 'lib/maintenance_tasks.rb', line 98

mattr_accessor :stuck_task_duration, default: 5.minutes

.tasks_moduleString

The module to namespace Tasks in, as a String. Defaults to ‘Maintenance’.

Returns:

  • (String)

    the name of the module.



22
# File 'lib/maintenance_tasks.rb', line 22

mattr_accessor :tasks_module, default: "Maintenance"

.ticker_delayActiveSupport::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.

Returns:

  • (ActiveSupport::Duration, Numeric)

    duration of the delay between updates to the tick count during Task iterations.



45
# File 'lib/maintenance_tasks.rb', line 45

mattr_accessor :ticker_delay, default: 1.second

Instance Attribute Details

#metadataObject



91
# File 'lib/maintenance_tasks.rb', line 91

mattr_accessor :metadata, default: nil