Commit d0a3a0e2 authored by Zac Wood's avatar Zac Wood
Browse files

Added back threading to make it SUPER FAST

parent 40540cf3
Pipeline #2878 passed with stage
in 2 minutes and 24 seconds
...@@ -7,7 +7,7 @@ require 'httparty' ...@@ -7,7 +7,7 @@ require 'httparty'
require 'nokogiri' require 'nokogiri'
require 'json' require 'json'
# threads = [] threads = []
total = {} total = {}
parser = PatriotWeb::Parser.new parser = PatriotWeb::Parser.new
...@@ -19,9 +19,9 @@ puts "DDOSing Patriot Web, buckle up kids" ...@@ -19,9 +19,9 @@ puts "DDOSing Patriot Web, buckle up kids"
# parse all subjects and their courses in the semester # parse all subjects and their courses in the semester
parser.parse_subjects(semester).each do |subject| parser.parse_subjects(semester).each do |subject|
puts "Getting courses for #{subject}" puts "Getting courses for #{subject}"
# threads << Thread.new { threads << Thread.new {
total[subject] = parser.parse_courses_in_subject(subject) total[subject] = parser.parse_courses_in_subject(subject)
# } }
end end
# For testing, only get first subject # For testing, only get first subject
...@@ -29,7 +29,7 @@ end ...@@ -29,7 +29,7 @@ end
# total[subject] = parser.parse_courses_in_subject(subject) # total[subject] = parser.parse_courses_in_subject(subject)
# wait for all the threads to finish # wait for all the threads to finish
# ThreadsWait.all_waits(*threads) ThreadsWait.all_waits(*threads)
# delete everything in the current database # delete everything in the current database
Closure.delete_all Closure.delete_all
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment