lib/loader/loader.rb in myreplicator-1.1.41 vs lib/loader/loader.rb in myreplicator-1.1.42

- old
+ new

@@ -16,13 +16,30 @@ ## # Main method provided for resque # Reconnection provided for resque workers ## - def self.perform - ActiveRecord::Base.verify_active_connections! - ActiveRecord::Base.connection.reconnect! - load # Kick off the load process + def self.perform *args + options = args.extract_options! + id = options[:id] + if id.blank? + ActiveRecord::Base.verify_active_connections! + ActiveRecord::Base.connection.reconnect! + load # Kick off the load process + else + ActiveRecord::Base.verify_active_connections! + ActiveRecord::Base.connection.reconnect! + load_id(id) + end + end + + ## + # Running loader for 1 export object + ## + def load_id id + + #Resque.enqueue(Myreplicator::Loader, id) + #Resque.enqueue(Myreplicator::Export,342) end ## # Kicks off all initial loads first and then all incrementals # Looks at metadata files stored locally