travis-backup 0.2.0 → 0.2.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: 85a9fa54e0b9f6637f1371e29d72682ff808bb2a1c7ee5e8d9432634f2961f14
4
- data.tar.gz: 96f242b4475d5b50f5a46bfb0e2aaac618aad78a7107a89977d4e5ffde103eba
3
+ metadata.gz: c3a6957efa5907a32acc218a7534d65d93e6062850a05e739fc7a627b3262170
4
+ data.tar.gz: 2dbc87cb85ade0a9d5e474dc8febab32d42cd788e2dfbab8aa7d1431c623d2bf
5
5
  SHA512:
6
- metadata.gz: 343866ae70df1f9f7c5fccdbc49f350c4d58ff195c9c527dd13995f3a66710b09ac53e269ab03eacaa36e6c0a17004d58635aec7c5ce0f7fce5d44c1029282de
7
- data.tar.gz: f6f2a7d430da5bdfb6ece3de27c4c7201061071f6636e4d16f7dc3b70f04b922d1d0e80b87c78bdec33bdf42fa267c7d46ed733dc91eaccb8d094ec1e7005c22
6
+ metadata.gz: 23b3148e39e799d9469c644eeec023fa07341e73d41ba68f29964977e36cd99a809545f5653433d456a770295a09f232aaa6a5bbe12e5b0914780d00da770ebd
7
+ data.tar.gz: 51ffab92a8164a5ccb0e2661a139705b8890b832df5370d9c32694a896c74c952234276ec6ec737b3cd3646e2b6541adece984fcd7c2d47d1b8b234f0d39c854
data/.travis.yml CHANGED
@@ -11,7 +11,7 @@ env:
11
11
  jobs:
12
12
  include:
13
13
  - stage: "testing time"
14
- script: bundle exec rspec
14
+ script: bundle exec rspec --tag ~slow
15
15
 
16
16
  dist: xenial
17
17
 
@@ -15,18 +15,24 @@ class Backup
15
15
 
16
16
  @db_helper.connect_db(@config.database_url)
17
17
  Log.order(:id).in_batches(of: @config.limit.to_i).map do |logs_batch|
18
- log_hashes = logs_batch.as_json
19
- @db_helper.connect_db(@config.destination_db_url)
20
-
21
- log_hashes.each do |log_hash|
22
- new_log = Log.new(log_hash)
23
- new_log.save!
24
- end
18
+ process_logs_batch(logs_batch)
19
+ end
20
+ end
25
21
 
26
- @db_helper.connect_db(@config.database_url)
22
+ def process_logs_batch(logs_batch)
23
+ log_hashes = logs_batch.as_json
24
+ @db_helper.connect_db(@config.destination_db_url)
27
25
 
28
- logs_batch.each(&:destroy)
26
+ log_hashes.each do |log_hash|
27
+ new_log = Log.new(log_hash)
28
+ new_log.save!
29
29
  end
30
+
31
+ @db_helper.connect_db(@config.database_url)
32
+
33
+ logs_batch.each(&:destroy)
34
+
35
+ GC.start
30
36
  end
31
37
 
32
38
  def run_dry
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'travis-backup'
3
- s.version = '0.2.0'
3
+ s.version = '0.2.1'
4
4
  s.summary = 'Travis CI backup tool'
5
5
  s.authors = ['Karol Selak']
6
6
  s.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: travis-backup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karol Selak
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-22 00:00:00.000000000 Z
11
+ date: 2021-10-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord