Skip to content

Commit 1f23e55

Browse files
fix(Kill): kill route
1 parent fafa6c9 commit 1f23e55

File tree

4 files changed

+38
-3
lines changed

4 files changed

+38
-3
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ __pycache__
99
.vscode
1010
uploads
1111
node_modules
12-
schemas.json
1312
.mypy_cache
1413
*.db
14+
opengeodeweb_back_schemas.json

package-lock.json

Lines changed: 14 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/opengeodeweb_back/routes/blueprint_routes.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,3 +381,16 @@ def ping():
381381
utils_functions.validate_request(flask.request, ping_json)
382382
flask.current_app.config.update(LAST_PING_TIME=time.time())
383383
return flask.make_response({"message": "Flask server is running"}, 200)
384+
385+
386+
with open(
387+
os.path.join(schemas, "kill.json"),
388+
"r",
389+
) as file:
390+
kill_json = json.load(file)
391+
392+
393+
@routes.route(kill_json["route"], methods=kill_json["methods"])
394+
def kill() -> None:
395+
print("Manual server kill, shutting down...", flush=True)
396+
os._exit(0)
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"route": "/kill",
3+
"methods": [
4+
"POST"
5+
],
6+
"type": "object",
7+
"properties": {},
8+
"required": [],
9+
"additionalProperties": false
10+
}

0 commit comments

Comments
 (0)