Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RHELMISC-2863: Try to restart CI process when start_studio_service fails #61

Conversation

Jedoku
Copy link
Contributor

@Jedoku Jedoku commented Feb 6, 2025

No description provided.

@Jedoku Jedoku changed the title RHELMISC-2863A: Try to restart CI process when start_studio_service fails RHELMISC-2863: Try to restart CI process when start_studio_service fails Feb 6, 2025
@Jedoku Jedoku force-pushed the RHELMISC-2863-Try-to-restart-CI-process-when-start-studio-service-fails branch from b092cba to 6a94d0f Compare February 12, 2025 10:02
lib/rtoolsHCK.rb Outdated
Comment on lines 178 to 189
def start_studio_service(service_name)
run("Start-Service #{service_name}")
retries = 0
timeout = 30
begin
run("Start-Service #{service_name}")
rescue WinrmPSRunError => e
raise e unless (retries += 1) < 3

logger('warn', "#{e.message} Retrying in #{timeout} seconds...")
sleep(timeout)

retry
end
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move timeout and 3(max retry count) to global constant

No need for an extra begin/end block just use retries ||= 0

Signed-off-by: Vitalii Chulak <vitalii@daynix.com>
@Jedoku Jedoku force-pushed the RHELMISC-2863-Try-to-restart-CI-process-when-start-studio-service-fails branch from 6a94d0f to d660ff5 Compare February 19, 2025 00:56
@Jedoku Jedoku requested a review from kostyanf14 February 24, 2025 14:30
@kostyanf14 kostyanf14 merged commit 27470d1 into master Feb 25, 2025
1 check passed
@kostyanf14 kostyanf14 deleted the RHELMISC-2863-Try-to-restart-CI-process-when-start-studio-service-fails branch February 25, 2025 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants