Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ __pycache__
.vscode
uploads
node_modules
schemas.json
.mypy_cache
*.db
opengeodeweb_back_schemas.json
16 changes: 14 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,3 @@ werkzeug==3.1.2
# flask
# flask-cors

opengeodeweb-microservice~=1.0
14 changes: 14 additions & 0 deletions src/opengeodeweb_back/routes/blueprint_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,3 +381,17 @@ def ping():
utils_functions.validate_request(flask.request, ping_json)
flask.current_app.config.update(LAST_PING_TIME=time.time())
return flask.make_response({"message": "Flask server is running"}, 200)


with open(
os.path.join(schemas, "kill.json"),
"r",
) as file:
kill_json = json.load(file)


@routes.route(kill_json["route"], methods=kill_json["methods"])
def kill() -> flask.Response:
print("Manual server kill, shutting down...", flush=True)
os._exit(0)
return flask.make_response({"message": "Flask server is dead"}, 200)
10 changes: 10 additions & 0 deletions src/opengeodeweb_back/routes/schemas/kill.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"route": "/kill",
"methods": [
"POST"
],
"type": "object",
"properties": {},
"required": [],
"additionalProperties": false
}