mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-03 15:20:45 -05:00
The test this status check was doing does not reflect real traffic of Notify. It is typical for messages to be in 'sending' for a while (people turn off their phone for example).
29 lines
751 B
Python
29 lines
751 B
Python
from flask import (
|
|
jsonify,
|
|
Blueprint,
|
|
request
|
|
)
|
|
|
|
from app import db, version
|
|
|
|
status = Blueprint('status', __name__)
|
|
|
|
|
|
@status.route('/_status', methods=['GET', 'POST'])
|
|
def show_status():
|
|
if request.args.get('elb', None):
|
|
return jsonify(status="ok"), 200
|
|
else:
|
|
return jsonify(
|
|
status="ok", # This should be considered part of the public API
|
|
travis_commit=version.__travis_commit__,
|
|
travis_build_number=version.__travis_job_number__,
|
|
build_time=version.__time__,
|
|
db_version=get_db_version()), 200
|
|
|
|
|
|
def get_db_version():
|
|
query = 'SELECT version_num FROM alembic_version'
|
|
full_name = db.session.execute(query).fetchone()[0]
|
|
return full_name
|