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 +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/rails_async_migrations.rb +7 -0
- data/lib/rails_async_migrations/version.rb +1 -1
- data/lib/rails_async_migrations/workers.rb +1 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e24a2ed40f0fcdc9da52564f3cbac3164f5f51caf2b3ae4e0a0c230740c0fce3
|
4
|
+
data.tar.gz: 6640134d706bf44a36d3d90758cb4830837c10bfb64f008b16f8b962829275e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf224109d383f1b7db33b8be88e6217e7fc4b771e8cd1509d2021f13619ebea6ae5aad0d4567167c7e1c1043b0d8d63b0d8261f7bee8d56a1b845f90e832447f
|
7
|
+
data.tar.gz: 699120d94bf4cd2aa17521efb7b034578ba81d9e8dfa02552df66ea7d19f6d60dc2ffc546da7e60f672d8a7ce0ac57b9a02c73590ec6aa86403ca2a6dac2f865
|
data/Gemfile.lock
CHANGED
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
|
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'
|
@@ -9,7 +9,7 @@ module RailsAsyncMigrations
|
|
9
9
|
ensure_worker_presence
|
10
10
|
end
|
11
11
|
|
12
|
-
def perform(args =
|
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.
|
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-
|
11
|
+
date: 2019-01-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|