Skip to content

Commit 7abbb53

Browse files
authored
Merge pull request #55 from ByteInternet/more-robust-dns-check
for more robust waitForAvailability
2 parents c42b0e3 + c6e320b commit 7abbb53

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

src/BrancherServer.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,34 @@ public function setSettings(array $settings): self
3535
$this->setOption(self::OPTION_HN_BRANCHER_SETTINGS, $settings);
3636
return $this;
3737
}
38+
39+
/**
40+
* @param int $timeout Maximum time in seconds to wait for brancher availability
41+
* @return $this
42+
*/
43+
public function setBrancherTimeout(int $timeout): self
44+
{
45+
$this->setOption(self::OPTION_HN_BRANCHER_TIMEOUT, $timeout);
46+
return $this;
47+
}
48+
49+
/**
50+
* @param int $count Number of consecutive successful reachability checks required
51+
* @return $this
52+
*/
53+
public function setBrancherReachabilityCheckCount(int $count): self
54+
{
55+
$this->setOption(self::OPTION_HN_BRANCHER_REACHABILITY_CHECK_COUNT, $count);
56+
return $this;
57+
}
58+
59+
/**
60+
* @param int $seconds Seconds between reachability checks
61+
* @return $this
62+
*/
63+
public function setBrancherReachabilityCheckInterval(int $seconds): self
64+
{
65+
$this->setOption(self::OPTION_HN_BRANCHER_REACHABILITY_CHECK_INTERVAL, $seconds);
66+
return $this;
67+
}
3868
}

src/Server.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ class Server
1010
public const OPTION_HN_BRANCHER = 'hn_brancher';
1111
public const OPTION_HN_BRANCHER_LABELS = 'hn_brancher_labels';
1212
public const OPTION_HN_BRANCHER_SETTINGS = 'hn_brancher_settings';
13+
public const OPTION_HN_BRANCHER_TIMEOUT = 'hn_brancher_timeout';
14+
public const OPTION_HN_BRANCHER_REACHABILITY_CHECK_COUNT = 'hn_brancher_reachability_check_count';
15+
public const OPTION_HN_BRANCHER_REACHABILITY_CHECK_INTERVAL = 'hn_brancher_reachability_check_interval';
1316
public const OPTION_HN_PARENT_APP = 'hn_parent_app';
1417

1518
/**

0 commit comments

Comments
 (0)