travis-backup 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/lib/backup/move_logs.rb +15 -9
- data/travis-backup.gemspec +1 -1
- 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: c3a6957efa5907a32acc218a7534d65d93e6062850a05e739fc7a627b3262170
|
4
|
+
data.tar.gz: 2dbc87cb85ade0a9d5e474dc8febab32d42cd788e2dfbab8aa7d1431c623d2bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23b3148e39e799d9469c644eeec023fa07341e73d41ba68f29964977e36cd99a809545f5653433d456a770295a09f232aaa6a5bbe12e5b0914780d00da770ebd
|
7
|
+
data.tar.gz: 51ffab92a8164a5ccb0e2661a139705b8890b832df5370d9c32694a896c74c952234276ec6ec737b3cd3646e2b6541adece984fcd7c2d47d1b8b234f0d39c854
|
data/.travis.yml
CHANGED
data/lib/backup/move_logs.rb
CHANGED
@@ -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
|
-
|
19
|
-
|
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
|
-
|
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
|
-
|
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
|
data/travis-backup.gemspec
CHANGED
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.
|
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-
|
11
|
+
date: 2021-10-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|