<commit_before>ResqueCleaner [ ![Travis-CI](https://secure.travis-ci.org/ono/resque-cleaner.png?branch=master "Travis CI") ](http://travis-ci.org/ono/resque-cleaner "Travis CI for resque-cleaner")
==============

[github.com/ono/resque-cleaner](https://github.com/ono/resque-cleaner)


Description
-----------

ResqueCleaner is a [Resque](https://github.com/defunkt/resque) plugin which
aims to help you to clean up failed jobs on Resque by:

* Showing stats of failed jobs
* Retrying failed jobs
* Removing failed jobs
* Filtering failed jobs


Installation
------------

Install as a gem:

    $ gem install resque-cleaner


Resque-Web integration
----------------------

![Screen 1](https://github.com/ono/resque-cleaner/raw/master/misc/resque-cleaner-main.png)
![Screen 2](https://github.com/ono/resque-cleaner/raw/master/misc/resque-cleaner-list.png)

You have to load ResqueCleaner to enable the Cleaner tab.

```ruby
    require 'resque-cleaner'
```

Console
-------

Hopefully a situation of your failed jobs is simple enough to get figured out through
the web interface. But, if not, a powerful filtering feature of ResqueCleaner may help
you to understand what is going on with your console(irb).

**Create Instance**

```ruby
    > cleaner = Resque::Plugins::ResqueCleaner.new
```

**Show Stats**

Shows stats of failed jobs grouped by date.

```ruby
    > cleaner.stats_by_date
    2009/03/13:    6
    2009/11/13:   14
    2010/08/13:   22
         total:   42
    => {'2009/03/10' => 6, ...}
```

You could also group them by class.

```ruby<commit_msg>add configuration section in readme<commit_after>ResqueCleaner [ ![Travis-CI](https://secure.travis-ci.org/ono/resque-cleaner.png?branch=master "Travis CI") ](http://travis-ci.org/ono/resque-cleaner "Travis CI for resque-cleaner")
==============

[github.com/ono/resque-cleaner](https://github.com/ono/resque-cleaner)


Description
-----------

ResqueCleaner is a [Resque](https://github.com/defunkt/resque) plugin which
aims to help you to clean up failed jobs on Resque by:

* Showing stats of failed jobs
* Retrying failed jobs
* Removing failed jobs
* Filtering failed jobs


Installation
------------

Install as a gem:

    $ gem install resque-cleaner


Resque-Web integration
----------------------

![Screen 1](https://github.com/ono/resque-cleaner/raw/master/misc/resque-cleaner-main.png)
![Screen 2](https://github.com/ono/resque-cleaner/raw/master/misc/resque-cleaner-list.png)


Configuration
-------------

At first, you have to load ResqueCleaner to enable the Cleaner tab. Here is
an example step.

1. Create a configuration file for resque-web
<br/>```touch [app_dir]/config/resque-web.rb```

2. Add the following line into the file
<br/>```require 'resque-cleaner'```

3. Then pass the file when you start resque-web
<br/>```% resque-web [app_dir]/config/resque-web.rb```

You can also configure [limiter](https://github.com/ono/resque-cleaner#limiter)
in the file.

e.g.

```ruby
require 'resque-cleaner'
module Resque::Plugins
  ResqueCleaner::Limiter.default_maximum = 10_000
end
```

Console
-------

Hopefully a situation of your failed jobs is simple enough to get figured out through
the web interface. But, if not, a powerful filtering feature of ResqueCleaner may help
you to understand what is going on with your console(irb).

**Create Instance**

```ruby
    > cleaner = Resque::Plugins::ResqueCleaner.new
```

**Show Stats**

Shows stats of failed jobs grouped by date.

```ruby
    > cleaner.stats_by_date
    2009/03/13:    6
    2009/11/13:   14
    2010/08/13:   22
         total:   42
    => {'2009/03/10' => 6, ...}
```

You could also group them by class.

```ruby
{'fraction_non_alphanumeric': 0.15940054495912806, 'fraction_numerical': 0.025068119891008173, 'mean_word_length': 3.344378698224852, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 14, 'https://': 11, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4774373', 'n_tokens_mistral': 1309, 'n_tokens_neox': 1204, 'n_words': 346}