sidekiq-sequence 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c624a6fd72d24ee9e41f0efc66acbab3ae57fc99ddc38121c76b25f34b2dbf95
4
- data.tar.gz: 7af58740782a790349cfcb31416eda672310782887270e5709c905b6f3d5f518
3
+ metadata.gz: e8fb7fdbff31fa339656b2453392445010ac7d13362ab1e355211a3b4a350ea6
4
+ data.tar.gz: 1f8c52a4660661d64eab08da81a2dde6c022d47433e1f3de2fedc09ab8ba0705
5
5
  SHA512:
6
- metadata.gz: 98b0ec2a669b2b8b632f00494b48aa5e3a953e297b4ca09fd5f5402c763f96c1ae441e9276ab37d139bbbd71fb4b937a0e546ca92bafadfe0dd00f6c25e841e0
7
- data.tar.gz: 295b926a199219d4b9a0f8df2e877ab0a9aedd658fe4afc40bc1d9c01055d8fd6a04cdf0461fb3a0e8dcd476a8ad3f7e19e4ea7288eb3a8b58ae28e06829bbde
6
+ metadata.gz: e3f1dfcd12cee1e6cfa4dc166423009e2eda6a52db3033fceceabb22bf621b653089213b601352330f0c7aa0e288a533b92347017030ed9674ded62d4a05fdbf
7
+ data.tar.gz: 53fb71d53142274fc83897be48525979f4f857c5cd6bd7fbfbe2c24a6f1fd85291d30a9218e06a488bf9430af2c645bc9bad0b417fa7f54d845b1ceb23c3454c
data/README.md CHANGED
@@ -1,8 +1,10 @@
1
1
  # Sidekiq::Sequence - Sequential Sidekiq jobs.
2
2
 
3
- Sidekiq is awesome, but it doesn't provide any support for sequential jobs, where a sequence of jobs must be run in a set order. Sidekiq::Sequence provides a simple but powerful framework to run a sequence of Sidekiq jobs.
3
+ Sidekiq is awesome, but it doesn't provide any support for sequential jobs, where a sequence of jobs must be run in a set order.
4
4
 
5
- Sidekiq::Sequence is currently only intended for use in Rails applications.
5
+ Sidekiq::Sequence provides a simple yet powerful framework to run a sequence of Sidekiq jobs, where each job runs only when the previous job successfully completes. It relies on Sidekiq's retry functionality to handle failed jobs. So if a job fails, any subsequent jobs will not run. Once the job is retried and is successful, the next job will start.
6
+
7
+ > **NOTE:** Sidekiq::Sequence is currently only intended for use in Rails applications.
6
8
 
7
9
  ## Installation
8
10
 
@@ -4,4 +4,6 @@ class Sidekiq::Sequence::Record < ApplicationRecord
4
4
  def self.table_name_prefix
5
5
  'sidekiq_sequence_'
6
6
  end
7
+
8
+ serialize :data, JSON unless connection.adapter_name =~ /postg|mysql/i
7
9
  end
@@ -19,6 +19,17 @@ module SidekiqSequence
19
19
  def migration_version
20
20
  "[#{ActiveRecord::VERSION::MAJOR}.#{ActiveRecord::VERSION::MINOR}]"
21
21
  end
22
+
23
+ def properties_type
24
+ case ActiveRecord::Base.connection_config[:adapter].to_s
25
+ when /postg/i # postgres, postgis
26
+ 'jsonb'
27
+ when /mysql/i
28
+ 'json'
29
+ else
30
+ 'text'
31
+ end
32
+ end
22
33
  end
23
34
  end
24
35
  end
@@ -1,7 +1,7 @@
1
1
  class <%= migration_class_name %> < ActiveRecord::Migration<%= migration_version %>
2
2
  def change
3
3
  create_table :sidekiq_sequence_records do |t|
4
- t.jsonb :data, default: {}
4
+ t.<%= properties_type %> :data
5
5
  t.integer :current_step, default: 0
6
6
  t.timestamps
7
7
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Sidekiq
4
4
  module Sequence
5
- VERSION = '0.1.0'
5
+ VERSION = '0.1.1'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq-sequence
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joel Moss
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-12 00:00:00.000000000 Z
11
+ date: 2020-06-13 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Create and manage sequential jobs in Sidekiq
14
14
  email: