From 7297cff5b674a61fd57ccc46eb75173011bd205c Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 28 Apr 2014 23:57:48 -0400 Subject: fix riot_api --- app/models/statistic.rb | 2 +- lib/sampling/riot_api.rb | 5 ++--- lib/throttled_api_request.rb | 1 - 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/app/models/statistic.rb b/app/models/statistic.rb index b4608b8..fefa3a8 100644 --- a/app/models/statistic.rb +++ b/app/models/statistic.rb @@ -16,7 +16,7 @@ class Statistic < ActiveRecord::Base after_save :update_match def update_match - if (self.name == "win") and (self.value > 0) + if (self.name == "win") and (self.value) self.match.winner = self.match.teams.find{|t| t.users.include? self.user} end if (self.match.status == 2) and (self.match.finished?) diff --git a/lib/sampling/riot_api.rb b/lib/sampling/riot_api.rb index 18a5ee7..bbe9cea 100644 --- a/lib/sampling/riot_api.rb +++ b/lib/sampling/riot_api.rb @@ -62,10 +62,11 @@ module Sampling if status[0] != "200" raise "GET #{@url} => #{status.join(" ")}" end - self.handle(data) + return self.handle(data) end def handle(data) + return true end end @@ -176,7 +177,6 @@ module Sampling super("v1.3/game/by-summoner/%{summonerId}/recent", { :summonerId => summoner["id"] }) end def handle(data) - puts("handling...") user = User.find(@user_id) match = Match.find(@match_id) if @last_game_id.nil? @@ -191,7 +191,6 @@ module Sampling end end end - puts("done handling") end end diff --git a/lib/throttled_api_request.rb b/lib/throttled_api_request.rb index b632d1e..c48a66d 100644 --- a/lib/throttled_api_request.rb +++ b/lib/throttled_api_request.rb @@ -23,7 +23,6 @@ class ThrottledApiRequest < Struct.new(:api_name, :limits) end end if sleep_for != -1 - puts "sleeping for #{sleeping_for}" sleep(sleep_for) else break -- cgit v1.2.3