Skip to content

Commit

Permalink
Add typical workflow to README
Browse files Browse the repository at this point in the history
Currently, it is easy to overlook the section mentioning running tasks via the
web UI. By adding a typical workflow, and some section headings, we make this
clearer.
  • Loading branch information
sambostock committed Jul 5, 2022
1 parent fdaa1bf commit 240ecb3
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,18 @@ For more information, please consult the [Rails guides on autoloading and reload

## Usage

The typical Maintenance Tasks workflow is as follows:

1. [Generate a class describing the Task](#creating-a-task) and the work to be done.
2. Run the Task
- either by [using the included web UI](#running-a-task-from-the-web-ui),
- or by [using the command line](#running-a-task-from-the-command-line),
- or by [using Ruby](#running-a-task-from-ruby).
3. [Monitor the Task](#monitoring-your-tasks-status)
- either by using the included web UI,
- or by manually checking your task's run's status in your database.
4. Optionally, delete the Task code if you no longer need it.

### Creating a Task

A generator is provided to create tasks. Generate a new task by running:
Expand Down Expand Up @@ -500,8 +512,12 @@ end

### Running a Task

#### Running a Task from the Web UI

You can run your new Task by accessing the Web UI and clicking on "Run".

#### Running a Task from the command line

Alternatively, you can run your Task in the command line:

```sh-session
Expand All @@ -528,6 +544,8 @@ bundle exec maintenance_tasks perform Maintenance::ParamsTask \
--arguments post_ids:1,2,3 content:"Hello, World!"
```

#### Running a Task from Ruby

You can also run a Task in Ruby by sending `run` with a Task name to Runner:

```ruby
Expand Down

0 comments on commit 240ecb3

Please sign in to comment.