From 3df404422d47fa942c5de61f30e73117a44db40c Mon Sep 17 00:00:00 2001 From: "Brian T. Smith" Date: Sun, 3 Jan 2016 22:30:22 -0600 Subject: [PATCH] VRFS-3644 added test against MAX_TRACKS environment variable to limit quantity of jam tracks imported from production. --- ruby/lib/jam_ruby/jam_track_importer.rb | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/ruby/lib/jam_ruby/jam_track_importer.rb b/ruby/lib/jam_ruby/jam_track_importer.rb index c6a6549b3..7472cac5e 100644 --- a/ruby/lib/jam_ruby/jam_track_importer.rb +++ b/ruby/lib/jam_ruby/jam_track_importer.rb @@ -2868,6 +2868,17 @@ module JamRuby end end + def import_count_exceeded?(count) + max = ENV['MAX_TRACKS'] + begin + if Integer(max) <= count + return true + end + rescue + end + return false + end + def synchronize_all(options) importers = [] @@ -2883,9 +2894,10 @@ module JamRuby count+=1 end - if count > 500 - #break + if import_count_exceeded?(count) + break end + end