Class: TimetableRepl

Inherits:
Sinatra::Base
  • Object
show all
Includes:
Neo4jBolt
Defined in:
src/ruby/timetable-repl.rb

Class Method Summary collapse

Class Method Details

.perform_update(which) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'src/ruby/timetable-repl.rb', line 20

def self.perform_update(which)
    begin
        debug ">>> Updating #{which}!"
        start_time = Time.now
        file_count = 0
        if which == 'all'
            file_count = @@timetable.update(nil)
        else
            file_count = @@timetable.update(Set.new([which]))
        end
        end_time = Time.now
        debug sprintf("<<< Finished updating #{which} in %1.2f seconds, wrote #{file_count} files.", (end_time - start_time).to_f)
    rescue StandardError => e
        STDERR.puts e
        STDERR.puts e.backtrace
    end
end