From 881cae6afa9ebce24acd4426aa5a411491ef1115 Mon Sep 17 00:00:00 2001 From: Wedge Date: Tue, 2 Feb 2016 21:40:02 +0300 Subject: [PATCH] Fixed bug, when redis spop returns a string and it is being compared to an integer --- app/models/build_list.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/build_list.rb b/app/models/build_list.rb index 06987d252..7da13c0bc 100644 --- a/app/models/build_list.rb +++ b/app/models/build_list.rb @@ -618,7 +618,7 @@ class BuildList < ActiveRecord::Base end def self.next_build_from_queue(set, arch_ids, platform_ids) - kind_id = Redis.current.spop(set) + kind_id = Redis.current.spop(set).to_i key = case set when USER_BUILDS_SET @@ -630,7 +630,7 @@ class BuildList < ActiveRecord::Base task = Resque.pop(key) if key if task || Redis.current.llen("resque:queue:#{key}") > 0 - Redis.current.sadd(set, kind_id) + Redis.current.sadd(set, kind_id.to_s) end build_list = BuildList.where(id: task['args'][0]['id']).first if task