rails_async_migrations 1.0.0 → 1.0.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: a9ffc3ef530a9f156013b067663ddeea6b06c65e155a668c56936b6803a50945
4
- data.tar.gz: e72fe2f4fe6289eff981e77653a3a1d00b97a90bd4750138a816ca38ea2a594f
3
+ metadata.gz: e24a2ed40f0fcdc9da52564f3cbac3164f5f51caf2b3ae4e0a0c230740c0fce3
4
+ data.tar.gz: 6640134d706bf44a36d3d90758cb4830837c10bfb64f008b16f8b962829275e5
5
5
  SHA512:
6
- metadata.gz: 42e96d488de2c1b5d49b039e0174a193cfcbccae1fa619526e46f91b9edb840cf4f2c7041f325f43800cd705d3b5935d694b798402f7d9f3c6b34697fd721885
7
- data.tar.gz: e8de2e332165ebdd35554bb1df53c74b77f5a3dd884cafe9624f522bcec133810b589e8c89263cad1097ead136f0d4e7f2ad0b2a660373c325c158d244b56f1b
6
+ metadata.gz: cf224109d383f1b7db33b8be88e6217e7fc4b771e8cd1509d2021f13619ebea6ae5aad0d4567167c7e1c1043b0d8d63b0d8261f7bee8d56a1b845f90e832447f
7
+ data.tar.gz: 699120d94bf4cd2aa17521efb7b034578ba81d9e8dfa02552df66ea7d19f6d60dc2ffc546da7e60f672d8a7ce0ac57b9a02c73590ec6aa86403ca2a6dac2f865
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rails_async_migrations (1.0.0)
4
+ rails_async_migrations (1.0.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -13,7 +13,7 @@ Most people turn heavy data changes into `rake tasks` or split workers; there ar
13
13
  1. Migrations should only mutate database structures and not its data, and if it's the case, it should be split and processed via other means.
14
14
  2. Migrations are everything which alter data one time, typically during a deployment of new code and structure.
15
15
 
16
- Turning data changes into a `rake task` can be a good idea, and it's ideal to test it out too, but sometimes you need this **fat ass loop** of **>1,000,000 records** which will be run **once, and only once** to be run fast and without locking down the deployment process itself; making a `rake task` for that is overkill. After all, it will only be used once and within a specific structure / data conxtext. This gem is here to answer this need.
16
+ Turning data changes into a `rake task` can be a good idea, and it's ideal to test it out too, but sometimes you need this **fat ass loop** of **>1,000,000 records** which will be run **once, and only once** to be run fast and without locking down the deployment process itself; making a `rake task` for that is overkill. After all, it will only be used once and within a specific structure / data context. This gem is here to answer this need.
17
17
 
18
18
  ## Installation
19
19
 
@@ -1,6 +1,13 @@
1
1
  require 'active_support'
2
2
  require 'active_record'
3
3
 
4
+ begin
5
+ require 'sidekiq'
6
+ require 'rails_async_migrations/workers/sidekiq/check_queue_worker'
7
+ require 'rails_async_migrations/workers/sidekiq/fire_migration_worker'
8
+ rescue LoadError
9
+ end
10
+
4
11
  require 'rails_async_migrations/connection/active_record'
5
12
  require 'rails_async_migrations/config'
6
13
  require 'rails_async_migrations/migration'
@@ -1,3 +1,3 @@
1
1
  module RailsAsyncMigrations
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
@@ -9,7 +9,7 @@ module RailsAsyncMigrations
9
9
  ensure_worker_presence
10
10
  end
11
11
 
12
- def perform(args = nil)
12
+ def perform(args = [])
13
13
  return unless ALLOWED.include? called_worker
14
14
  self.send called_worker, *args
15
15
  end
@@ -41,10 +41,6 @@ module RailsAsyncMigrations
41
41
  def ensure_worker_presence
42
42
  case workers_type
43
43
  when :sidekiq
44
- require 'sidekiq'
45
- require 'rails_async_migrations/workers/sidekiq/check_queue_worker'
46
- require 'rails_async_migrations/workers/sidekiq/fire_migration_worker'
47
-
48
44
  unless defined? ::Sidekiq::Worker
49
45
  raise Error, 'Please install Sidekiq before to set it as worker adapter'
50
46
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_async_migrations
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Laurent Schaffner
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-01-02 00:00:00.000000000 Z
11
+ date: 2019-01-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler