myreplicator 1.1.63 → 1.1.64

Sign up to get free protection for your applications and to get access to all the features.
@@ -66,11 +66,15 @@ module Myreplicator
66
66
 
67
67
  # making the hash for mapping filepath to metadata object
68
68
  all_files.each do |m|
69
- if !(@redis.hexists(@load_hash, m.filepath))
70
- @redis.hset(@load_hash, m.filepath, 0)
71
- @redis.sadd(@load_set, m.filepath)
69
+ if Myreplicator::Loader.transfer_completed? m
70
+ if !(@redis.hexists(@load_hash, m.filepath))
71
+ @redis.hset(@load_hash, m.filepath, 0)
72
+ @redis.sadd(@load_set, m.filepath)
73
+ end
74
+ files_to_metadata[m.filepath] = m
75
+ else
76
+ # for the fun of commenting: do nothing
72
77
  end
73
- files_to_metadata[m.filepath] = m
74
78
  end
75
79
 
76
80
  # processing the files in "queue"
@@ -152,7 +152,7 @@ module Myreplicator
152
152
  Loader.cleanup metadata #Remove incremental file
153
153
  Kernel.p "===== Remove incremental file ====="
154
154
  end
155
- elsif exp.nightly_refresh && (exp.nightly_refresh_frequency != 0) && ((Time.now() - exp.nightly_refresh_last_run) >= exp.nightly_refresh_frequency.minute)
155
+ elsif exp.nightly_refresh && (exp.nightly_refresh_frequency != 0) && ((Time.now() - exp.nightly_refresh_last_run) >= exp.nightly_refresh_frequency.minute) && (Time.now().hour >= 21)
156
156
  Loader.clear_older_files metadata # clear old incremental files
157
157
  exp.nightly_refresh_last_run = Time.now().change(:min => 0)
158
158
  exp.save!
@@ -162,7 +162,7 @@ module Myreplicator
162
162
  exp.export
163
163
  elsif get_analyze_constraints(ops) > 0 # check for primary key/unique keys violations
164
164
  Kernel.p "===== DROP CURRENT TABLE ====="
165
- sql = "DROP TABLE IF EXISTS #{options[:db]}.#{options[:destination_schema]}.#{options[:table_name]} CASCADE;"
165
+ sql = "TRUNCATE TABLE #{options[:db]}.#{options[:destination_schema]}.#{options[:table_name]};"
166
166
  Myreplicator::DB.exec_sql("vertica",sql)
167
167
  # run the export. The next time loader runs, it will load the file
168
168
  exp.export
@@ -1,3 +1,3 @@
1
1
  module Myreplicator
2
- VERSION = "1.1.63"
2
+ VERSION = "1.1.64"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: myreplicator
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.63
4
+ version: 1.1.64
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -358,7 +358,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
358
358
  version: '0'
359
359
  segments:
360
360
  - 0
361
- hash: -3516789411142230801
361
+ hash: 2729168572635987474
362
362
  required_rubygems_version: !ruby/object:Gem::Requirement
363
363
  none: false
364
364
  requirements:
@@ -367,7 +367,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
367
367
  version: '0'
368
368
  segments:
369
369
  - 0
370
- hash: -3516789411142230801
370
+ hash: 2729168572635987474
371
371
  requirements: []
372
372
  rubyforge_project:
373
373
  rubygems_version: 1.8.24