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
Adds content-app to status API #183
Conversation
Codecov Report
@@ Coverage Diff @@
## master #183 +/- ##
==========================================
+ Coverage 67.31% 67.53% +0.21%
==========================================
Files 65 66 +1
Lines 3087 3123 +36
==========================================
+ Hits 2078 2109 +31
- Misses 1009 1014 +5
Continue to review full report at Codecov.
|
49cb4bd
to
5bd6658
Compare
pulpcore/app/models/status.py
Outdated
now = timezone.now() | ||
age_threshold = now - timedelta(seconds=settings.CONTENT_APP_TTL) | ||
|
||
return self.last_heartbeat < age_threshold |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about returning not online()
to de-dupe logic?
5bd6658
to
96f6fec
Compare
A new model is introduced called `ContentAppStatus` is introduced which will record status check-in records from the Content App. The Content App will check in periodically checkin and write to the `ContentAppStatus` object. To tell the ContentAppStatus records apart for multiple Content Apps each Content App now requires a name. The name is auto-selected as '{pid}@{hostname}'. The Status API viewset now shows a 'content_apps' section which lists the ContentAppStatus records, showing their names and last heartbeat time. Adds a doc and feature changelog entries. https://pulp.plan.io/issues/4881 closes pulp#4881
96f6fec
to
9d6d2f2
Compare
A new model is introduced called
ContentAppStatus
is introduced whichwill record status check-in records from the Content App.
The Content App will check in periodically checkin and write to the
ContentAppStatus
object.To tell the ContentAppStatus records apart for multiple Content Apps
each Content App now requires a name. The name is auto-selected as
'{pid}@{hostname}'.
The Status API viewset now shows a 'content_apps' section which lists
the ContentAppStatus records, showing their names and last heartbeat
time.
Adds a doc and feature changelog entries.
https://pulp.plan.io/issues/4881
closes #4881