batch_manager 0.3.8 → 0.3.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/batch_manager/executor.rb +4 -2
- data/lib/batch_manager/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1f126c36d799f8c8ecf3e7f5d6d2f516039a6ef9
|
4
|
+
data.tar.gz: 24ec977d830ca47e3ba5b742dfd7d03c1110f1b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d6ed61ecfe20421b6c14dc831fc55cdc9c9c812336afc89e2ef301f573fe34406a1c241209fe0c5c55f1da0d4b49533e4fc8553f4b920dddbfc0d72258046c92
|
7
|
+
data.tar.gz: 2b1e126e9575b5965bc713b635cfded66c6f03dfdf2c0cbce067f1726fda35a52ad91b50cdf9c2acbde3f183f7c5e8fa32448ce1aa4dc4c89cff84ca55f6ef48
|
@@ -9,7 +9,7 @@ module BatchManager
|
|
9
9
|
@batch_status = BatchManager::BatchStatus.new(@batch_file_path)
|
10
10
|
@wet = options[:wet]
|
11
11
|
if options[:force] || !@wet || @batch_status.can_run?
|
12
|
-
|
12
|
+
logging_run_duration { exec_batch_script }
|
13
13
|
else
|
14
14
|
raise "Cannot run this batch."
|
15
15
|
end
|
@@ -20,7 +20,7 @@ module BatchManager
|
|
20
20
|
|
21
21
|
protected
|
22
22
|
|
23
|
-
def
|
23
|
+
def logging_run_duration
|
24
24
|
@logger = BatchManager::Logger.new(@batch_status.name, @wet)
|
25
25
|
start_at = Time.now
|
26
26
|
yield
|
@@ -34,6 +34,8 @@ module BatchManager
|
|
34
34
|
eval(File.read(@batch_file_path), nil, @batch_file_path)
|
35
35
|
@logger.info "Succeeded."
|
36
36
|
@batch_status.update_schema if @wet
|
37
|
+
rescue => e
|
38
|
+
@logger.error e
|
37
39
|
ensure
|
38
40
|
puts "Log saved at: #{@logger.log_file}" if @logger.log_file
|
39
41
|
end
|