Skip to content

Commit

Permalink
Increase image restore check interval to reduce DO api load (#2095)
Browse files Browse the repository at this point in the history
* Bump onlyoffice_digitalocean_wrapper from 0.8.0 to 0.9.0

Bumps [onlyoffice_digitalocean_wrapper](https://github.com/ONLYOFFICE-QA/onlyoffice_digitalocean_wrapper) from 0.8.0 to 0.9.0.
- [Release notes](https://github.com/ONLYOFFICE-QA/onlyoffice_digitalocean_wrapper/releases)
- [Changelog](https://github.com/ONLYOFFICE-QA/onlyoffice_digitalocean_wrapper/blob/master/CHANGELOG.md)
- [Commits](ONLYOFFICE-QA/onlyoffice_digitalocean_wrapper@v0.8.0...v0.9.0)

---
updated-dependencies:
- dependency-name: onlyoffice_digitalocean_wrapper
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* Increase image restore check interval to reduce DO api load

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Vitaliy Serov <[email protected]>
  • Loading branch information
dependabot[bot] and VitaliySerov authored Jul 7, 2024
1 parent d867ed6 commit 0464c0a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
* Fix `rubocop-1.64` cop `Style/SuperArguments` warnings.
* Actualize JS dependencies
* Update rubocop config to support v3 of `rubocop-rspec`
* Increase image restore check interval to reduce DO api load

### Fixes

Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ GEM
octokit (9.1.0)
faraday (>= 1, < 3)
sawyer (~> 0.9)
onlyoffice_digitalocean_wrapper (0.8.0)
onlyoffice_digitalocean_wrapper (0.9.0)
droplet_kit (~> 3)
net-telnet (~> 0)
onlyoffice_github_helper (1.4.0)
Expand Down
7 changes: 6 additions & 1 deletion app/models/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ class Server < ApplicationRecord
EXECUTOR_TAG = 'nct-at'
DEFAULT_SERVER_SIZE = '1gb'
STATUSES_TO_MANUAL_SET = %i[destroyed created].freeze
# @return [Integer] interval in seconds for checking image restore status
CLOUD_IMAGE_RESTORE_INTERVAL = 20

has_many :histories

Expand Down Expand Up @@ -76,7 +78,10 @@ def restore_image_and_wait(server_size)
update_column(:_status, :destroyed)
raise e
end
RunnerManagers.digital_ocean.wait_until_droplet_have_status(name, 'active', timeout: 60 * 15)
RunnerManagers.digital_ocean.wait_until_droplet_have_status(name,
'active',
timeout: 60 * 15,
interval: CLOUD_IMAGE_RESTORE_INTERVAL)
set_ip_info
OnlyofficeDigitaloceanWrapper::SshChecker.new(address).wait_until_ssh_up
end
Expand Down

0 comments on commit 0464c0a

Please sign in to comment.