activejob-status 1.1.0.beta.0 → 1.1.0.beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c2126b98461087723d25a787999e46ad568131c528d8b38d49d437700e9ee640
4
- data.tar.gz: 3cfa5a8c5783b0efef3f6f7db766681afe65ecad74ff2622b2104e1810c525cd
3
+ metadata.gz: 4f1bd65607a15788096d9c29d9701e1e364d0c06a38a828d47020066aa58bc1d
4
+ data.tar.gz: bb93bfca62b64094efa39ffc9090989811823e3867e56e13ef26f3b9549fc543
5
5
  SHA512:
6
- metadata.gz: 98dd6128baae8b40dba1e6de09f4d71b3ea2eb0d41764cca7f58b0d5f2672ff7d8e71ffd9b8e670eb71adb91772eb763b2e06c55becd7404d9640611e130e072
7
- data.tar.gz: 8340c579dbc672a62ca3821f9ded8c8f7a736ec87d476134fa96ed936c2988d83a2c3e612dca842f61cd5189e2385ca9022acce5a47696f411f59ea3a1fb3ca2
6
+ metadata.gz: 33fd1c21ab75459d93905cb60d26b8a69744396466f38f815d901e5e681d8199d34f97b8e1c954cb062c11522e4b026b0c04789639de6bb0388892a81ddfa670
7
+ data.tar.gz: b39763320c6510768803853b219e5ea8f46adbbd50d264d0b88f9478fa6f2a23f72d8c1c8306c88b552faf221205d121d66a76ff2266bd88749550c55f0b1208
data/README.md CHANGED
@@ -8,6 +8,24 @@ Simple monitoring status for ActiveJob, independent of your queuing backend or c
8
8
  [![Maintainability](https://api.codeclimate.com/v1/badges/a7b1ec1d3769e49021fd/maintainability)](https://codeclimate.com/github/inkstak/activejob-status/maintainability)
9
9
  [![Test Coverage](https://api.codeclimate.com/v1/badges/a7b1ec1d3769e49021fd/test_coverage)](https://codeclimate.com/github/inkstak/activejob-status/test_coverage)
10
10
 
11
+ ## Table of contents
12
+
13
+ - [Installation](#installation)
14
+ - [Dependencies](#dependencies)
15
+ - [Configuration](#configuration)
16
+ - [Cache Store](#cache-store)
17
+ - [Select data to store by default](#select-data-to-store-by-default)
18
+ - [Expiration time](#expiration-time)
19
+ - [Throttling](#throttling)
20
+ - [Usage](#usage)
21
+ - [Updating status](#updating-status)
22
+ - [Data stored by default](#data-stored-by-default)
23
+ - [Reading status](#reading-status)
24
+ - [Serializing status to JSON](#serializing-status-to-json)
25
+ - [Setting options per job](#setting-options-per-job)
26
+ - [ActiveJob::Status and exceptions](#activejobstatus-and-exceptions)
27
+ - [[Beta] Batches](#beta-batches)
28
+
11
29
  ## Installation
12
30
 
13
31
  ```bash
@@ -324,7 +342,7 @@ class MyJob < ActiveJob::Base
324
342
  end
325
343
  ```
326
344
 
327
- ## ActiveJob::Status and exceptions
345
+ ### ActiveJob::Status and exceptions
328
346
 
329
347
  Internally, ActiveJob::Status uses `ActiveSupport#rescue_from` to catch every `Exception` to apply the `failed` status
330
348
  before throwing the exception again.
@@ -386,7 +404,7 @@ end
386
404
 
387
405
  ### [Beta] Batches
388
406
 
389
- > **Warning** : The Batch API is available in beta:
407
+ > **Warning** : The Batch API is available on [beta](https://github.com/inkstak/activejob-status/tree/beta):
390
408
  >
391
409
  > ```bash
392
410
  > gem install activejob-status --pre
@@ -397,7 +415,7 @@ end
397
415
  > It doesn't provide all features implemented by backends
398
416
  > like [Sidekiq](https://github.com/sidekiq/sidekiq/wiki/Batches)
399
417
  > or [GoodJob](https://github.com/bensheldon/good_job?tab=readme-ov-file#batches).
400
- > Moreover, it wasn't designed to support batches with hundreds of jobs.
418
+ > Moreover, it wasn't designed to support batches with hundreds of jobs (or you might experience performanes issues).
401
419
  >
402
420
 
403
421
  ActiveJob::Status provides a naïve implementation of batches:
@@ -44,7 +44,9 @@ module ActiveJob
44
44
  end
45
45
 
46
46
  def progress
47
- read[:progress].to_f / read[:total].to_f
47
+ read.then do |hash|
48
+ hash[:progress].to_f / hash[:total].to_f
49
+ end
48
50
  end
49
51
 
50
52
  def present?
@@ -2,6 +2,6 @@
2
2
 
3
3
  module ActiveJob
4
4
  module Status
5
- VERSION = "1.1.0.beta.0"
5
+ VERSION = "1.1.0.beta.1"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activejob-status
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0.beta.0
4
+ version: 1.1.0.beta.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Savater Sebastien
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-02-18 00:00:00.000000000 Z
10
+ date: 2024-04-18 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: activejob
@@ -178,7 +177,6 @@ dependencies:
178
177
  - - ">="
179
178
  - !ruby/object:Gem::Version
180
179
  version: '0'
181
- description:
182
180
  email: github.60k5k@simplelogin.co
183
181
  executables: []
184
182
  extensions: []
@@ -197,7 +195,6 @@ homepage: https://github.com/inkstak/activejob-status
197
195
  licenses:
198
196
  - MIT
199
197
  metadata: {}
200
- post_install_message:
201
198
  rdoc_options: []
202
199
  require_paths:
203
200
  - lib
@@ -208,12 +205,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
208
205
  version: '0'
209
206
  required_rubygems_version: !ruby/object:Gem::Requirement
210
207
  requirements:
211
- - - ">"
208
+ - - ">="
212
209
  - !ruby/object:Gem::Version
213
- version: 1.3.1
210
+ version: '0'
214
211
  requirements: []
215
- rubygems_version: 3.4.6
216
- signing_key:
212
+ rubygems_version: 3.6.0.dev
217
213
  specification_version: 4
218
214
  summary: Monitor your jobs
219
215
  test_files: []