You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/07/02 12:41:28 UTC
[GitHub] [airflow] OmairK commented on a change in pull request #9277: [WIP] Health endpoint spec
OmairK commented on a change in pull request #9277:
URL: https://github.com/apache/airflow/pull/9277#discussion_r448971809
##########
File path: airflow/api_connexion/endpoints/health_endpoint.py
##########
@@ -14,13 +14,34 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-
-# TODO(mik-laj): We have to implement it.
-# Do you want to help? Please look at: https://github.com/apache/airflow/issues/8144
+from airflow.api_connexion.schemas.health_schema import health_schema
+from airflow.configuration import conf
+from airflow.jobs.scheduler_job import SchedulerJob
+from airflow.utils.session import provide_session
def get_health():
"""
- Checks if the API works
+ Return the health of the airflow scheduler and metadatabase
"""
- return "OK"
+ payload = {
+ 'metadatabase': {'status': 'unhealthy'}
+ }
+
+ latest_scheduler_heartbeat = None
+ scheduler_status = 'unhealthy'
+ payload['metadatabase'] = {'status': 'healthy'}
Review comment:
Thanks. [Fixed it](https://github.com/apache/airflow/pull/9277/files#diff-d7bb321505e9703c67dc7c78ff5b55deR25-R48)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org