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

better free port discovery #245

Merged
merged 3 commits into from
Jul 23, 2020
Merged

better free port discovery #245

merged 3 commits into from
Jul 23, 2020

Conversation

Uunnamed
Copy link
Contributor

#fixes #240

@@ -1821,9 +1821,9 @@
Returns a port as an integer."
[type host]
(loop [port (or (get-in defaults [type :port])
(util/random-port))]
(util/get-free-port))]
(if (connectable? host port)
Copy link
Collaborator

Choose a reason for hiding this comment

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

функцию connectable? лучше перенести в utils, потому что она не относится к api.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

она заявязана на макрос который объявлен в api, если перенести будет циклическая зависимость

(defn running?
"Check whether a driver runs HTTP server."
[driver]
(connectable? (:host @driver)
(util/connectable? (:host @driver)
(:port @driver)))
Copy link
Collaborator

Choose a reason for hiding this comment

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

тут выровнять второй аргумент

@Uunnamed Uunnamed merged commit 2fe41a7 into master Jul 23, 2020
@Uunnamed Uunnamed deleted the better-free-port-discovery branch July 23, 2020 10:32
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.

Better free port discovery
2 participants