From 44958c79bb833dea82147567cbac12fd24f2e23b Mon Sep 17 00:00:00 2001 From: oleghasjanov Date: Thu, 26 Sep 2024 15:13:04 +0300 Subject: [PATCH] added sleep delay configurable --- config/application.yml.sample | 4 +++- lib/tasks/company_status.rake | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/config/application.yml.sample b/config/application.yml.sample index edc587237..1fae6d98b 100644 --- a/config/application.yml.sample +++ b/config/application.yml.sample @@ -255,4 +255,6 @@ allow_accr_endspoints: 'true' whitelist_companies: - '12345678' - - '87654321' \ No newline at end of file + - '87654321' + +business_registry_sleep_time: 4 \ No newline at end of file diff --git a/lib/tasks/company_status.rake b/lib/tasks/company_status.rake index 924f2fa21..fd3c16eb0 100644 --- a/lib/tasks/company_status.rake +++ b/lib/tasks/company_status.rake @@ -153,7 +153,7 @@ namespace :company_status do end def sort_companies_to_files(contact:, missing_companies_in_business_registry_path:, deleted_companies_from_business_registry_path:, soft_delete_enable:) - sleep 1 + sleep ENV['business_registry_sleep_time'].present? ? ENV['business_registry_sleep_time'].to_i : 2 resp = contact.return_company_details if resp.empty?