Bugfixes: increase_rt and platform prohjects
This commit is contained in:
parent
b5ad578e88
commit
650bd22401
1
1.sh
1
1.sh
|
@ -1 +0,0 @@
|
||||||
QUEUE=low,publish_observer,rpm_worker_observer,iso_worker_observer,fork_import,hook,clone_build,middle,notification,publish_observer,rpm_worker_observer,iso_worker_observer,fork_import,hook,clone_build,middle,notification rake resque:work
|
|
|
@ -313,10 +313,14 @@ GEM
|
||||||
pg (0.18.2)
|
pg (0.18.2)
|
||||||
polyamorous (1.2.0)
|
polyamorous (1.2.0)
|
||||||
activerecord (>= 3.0)
|
activerecord (>= 3.0)
|
||||||
|
posix-spawn (0.3.11)
|
||||||
puma (2.11.3)
|
puma (2.11.3)
|
||||||
rack (>= 1.1, < 2.0)
|
rack (>= 1.1, < 2.0)
|
||||||
pundit (1.0.1)
|
pundit (1.0.1)
|
||||||
activesupport (>= 3.0.0)
|
activesupport (>= 3.0.0)
|
||||||
|
pygments.rb (0.6.3)
|
||||||
|
posix-spawn (~> 0.3.6)
|
||||||
|
yajl-ruby (~> 1.2.0)
|
||||||
rack (1.6.2)
|
rack (1.6.2)
|
||||||
rack-contrib (1.2.0)
|
rack-contrib (1.2.0)
|
||||||
rack (>= 0.9.1)
|
rack (>= 0.9.1)
|
||||||
|
@ -580,6 +584,7 @@ GEM
|
||||||
crack (>= 0.3.2)
|
crack (>= 0.3.2)
|
||||||
will_paginate (3.0.7)
|
will_paginate (3.0.7)
|
||||||
ya2yaml (0.31)
|
ya2yaml (0.31)
|
||||||
|
yajl-ruby (1.2.1)
|
||||||
|
|
||||||
PLATFORMS
|
PLATFORMS
|
||||||
ruby
|
ruby
|
||||||
|
@ -632,6 +637,7 @@ DEPENDENCIES
|
||||||
pg
|
pg
|
||||||
puma
|
puma
|
||||||
pundit
|
pundit
|
||||||
|
pygments.rb
|
||||||
rack-mini-profiler
|
rack-mini-profiler
|
||||||
rack-throttle (~> 0.3.0)
|
rack-throttle (~> 0.3.0)
|
||||||
rack-utf8_sanitizer
|
rack-utf8_sanitizer
|
||||||
|
|
|
@ -109,22 +109,22 @@ class MassBuild < ActiveRecord::Base
|
||||||
return if self.reload.stop_build
|
return if self.reload.stop_build
|
||||||
# Ensures that user has rights to create a build_list
|
# Ensures that user has rights to create a build_list
|
||||||
next unless ProjectPolicy.new(user, project).write?
|
next unless ProjectPolicy.new(user, project).write?
|
||||||
|
if increase_rt
|
||||||
|
if ratelimit_remaining <= 1
|
||||||
|
ratelimit_remaining = Github_blobs_api.ratelimit_remaining
|
||||||
|
#if that's still less that or equal 1
|
||||||
|
if ratelimit_remaining <= 1
|
||||||
|
#just to make sure it really resets wait additional 5 seconds
|
||||||
|
ratelimit_reset_wait = Github_blobs_api.ratelimit_reset - Time.now.to_i + 5
|
||||||
|
sleep ratelimit_reset_wait
|
||||||
|
ratelimit_remaining = Github_blobs_api.ratelimit_remaining
|
||||||
|
end
|
||||||
|
end
|
||||||
|
count = project.increase_release_tag(project_version, "MassBuild##{id}: Increase release tag")
|
||||||
|
ratelimit_remaining -= count
|
||||||
|
end
|
||||||
arches_list.each do |arch|
|
arches_list.each do |arch|
|
||||||
rep_id = (project.repository_ids & save_to_platform.repository_ids).first
|
rep_id = (project.repository_ids & save_to_platform.repository_ids).first
|
||||||
if increase_rt
|
|
||||||
if ratelimit_remaining <= 1
|
|
||||||
ratelimit_remaining = Github_blobs_api.ratelimit_remaining
|
|
||||||
#if that's still less that or equal 1
|
|
||||||
if ratelimit_remaining <= 1
|
|
||||||
#just to make sure it really resets wait additional 5 seconds
|
|
||||||
ratelimit_reset_wait = Github_blobs_api.ratelimit_reset - Time.now.to_i + 5
|
|
||||||
sleep ratelimit_reset_wait
|
|
||||||
ratelimit_remaining = Github_blobs_api.ratelimit_remaining
|
|
||||||
end
|
|
||||||
end
|
|
||||||
count = project.increase_release_tag(project_version, "MassBuild##{id}: Increase release tag")
|
|
||||||
ratelimit_remaining -= count
|
|
||||||
end
|
|
||||||
project.build_for(self, rep_id, project_version, arch, 0)
|
project.build_for(self, rep_id, project_version, arch, 0)
|
||||||
end
|
end
|
||||||
rescue RuntimeError, Exception => e
|
rescue RuntimeError, Exception => e
|
||||||
|
|
|
@ -5,7 +5,6 @@ json.projects @projects do |project|
|
||||||
json.visibility_class fa_visibility_icon(project)
|
json.visibility_class fa_visibility_icon(project)
|
||||||
json.path project_path(project.name_with_owner)
|
json.path project_path(project.name_with_owner)
|
||||||
json.name project.name_with_owner
|
json.name project.name_with_owner
|
||||||
json.description truncate(project.description || '', length: 60).gsub(/\n|\r|\t/, ' ')
|
|
||||||
if policy(@repository).remove_project?
|
if policy(@repository).remove_project?
|
||||||
json.remove_path remove_project_platform_repository_path(@platform, @repository, project_id: project.id)
|
json.remove_path remove_project_platform_repository_path(@platform, @repository, project_id: project.id)
|
||||||
end
|
end
|
||||||
|
|
|
@ -13,7 +13,7 @@ module RPM
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
attach_function 'rpmEVRcmp', [:string, :string], :int
|
#attach_function 'rpmEVRcmp', [:string, :string], :int
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue