Skip to content

Commit

Permalink
automatic: Skip network availability check without remote repo
Browse files Browse the repository at this point in the history
Network availability check uses remote repository URLs. If there is no
remote repository, skip the check.
This speeds up `dnf5 automatic` CI tests greatly because it skips
default 60 seconds timeout.
  • Loading branch information
m-blaha authored and jan-kolarik committed Mar 6, 2024
1 parent 287e545 commit 60722bd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions dnf5-plugins/automatic_plugin/automatic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,11 @@ void AutomaticCommand::wait_for_network() {
}
curl_url_cleanup(url);

if (addresses.size() == 0) {
// do not have any address to check availability for
return;
}

while (std::chrono::system_clock::now() < time_end) {
for (auto const & [host, service] : addresses) {
if (server_available(host, service)) {
Expand Down

0 comments on commit 60722bd

Please sign in to comment.