Skip to content
This repository has been archived by the owner on Nov 29, 2021. It is now read-only.

Start the server before initialize. #209

Merged
merged 7 commits into from
Feb 19, 2020
Merged

Conversation

jjnicola
Copy link
Member

This allows to create the socket and give a response to the client, while
the server is still in the initialization process.

@codecov
Copy link

codecov bot commented Feb 18, 2020

Codecov Report

Merging #209 into master will decrease coverage by 0.34%.
The diff coverage is 10%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #209      +/-   ##
==========================================
- Coverage   73.52%   73.17%   -0.35%     
==========================================
  Files          18       18              
  Lines        2130     2140      +10     
==========================================
  Hits         1566     1566              
- Misses        564      574      +10
Impacted Files Coverage Δ
ospd/misc.py 51.56% <ø> (+4.98%) ⬆️
ospd/main.py 0% <0%> (ø) ⬆️
ospd/ospd.py 72.72% <27.27%> (-0.59%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fa86a5e...46ccbae. Read the comment docs.

Copy link
Contributor

@bjoernricks bjoernricks left a comment

Choose a reason for hiding this comment

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

We should only pass the server once to the daemon instance. Therefore I am in favor of changing
daemon.run(server) to daemon.run() only. I've also thought about refactoring the complete initialization process of the daemon but passing the server to init should already provide all necessary use cases.

ospd/ospd.py Outdated Show resolved Hide resolved
This allows to create the socket and give a response to the client, while
the server is still in the initialization process.
ospd/main.py Outdated Show resolved Hide resolved
This new method it is the same as misc.remove_pidfile(), but it receives
the server too. It will close the server before exiting or during
KeyboardInterrupt exception.
Was replaced with exit_cleanup(), which closes the server socket too.
@jjnicola jjnicola merged commit 1da1f72 into greenbone:master Feb 19, 2020
@jjnicola jjnicola deleted the start-server branch February 19, 2020 14:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants