Increase builder clearing delay to 15 minutes

This commit is contained in:
DuratarskeyK 2019-02-04 19:11:22 +03:00 committed by GitHub
parent c990e8facf
commit a9fa7b6624
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -102,7 +102,7 @@ class Api::V1::JobsController < Api::V1::BaseController
def clear_stale_builders def clear_stale_builders
BuildList.transaction do BuildList.transaction do
BuildList.where(["updated_at < ?", 120.seconds.ago]).where(status: BuildList::BUILD_PENDING).where.not(builder: nil).find_each(batch_size: 50) do |bl| BuildList.where(["updated_at < ?", 900.seconds.ago]).where(status: BuildList::BUILD_PENDING).where.not(builder: nil).find_each(batch_size: 50) do |bl|
bl.update_column(:builder_id, nil) bl.update_column(:builder_id, nil)
end end
end end