Skip to content
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

Add endpoint to restart Frigate #8440

Merged
merged 3 commits into from Nov 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/docs/integrations/api.md
Expand Up @@ -365,3 +365,7 @@ Recording retention config still applies to manual events, if frigate is configu
### `PUT /api/events/<event_id>/end`

End a specific manual event without a predetermined length.

### `POST /api/restart`

Restarts Frigate process.
27 changes: 27 additions & 0 deletions frigate/http.py
Expand Up @@ -2103,3 +2103,30 @@ def logs(service: str):
jsonify({"success": False, "message": "Could not find log file"}),
500,
)


@bp.route("/restart", methods=["POST"])
def restart():
try:
restart_frigate()
except Exception as e:
logging.error(f"Error restarting Frigate: {e}")
return make_response(
jsonify(
{
"success": False,
"message": "Unable to restart Frigate.",
}
),
500,
)

return make_response(
jsonify(
{
"success": True,
"message": "Restarting (this can take up to one minute)...",
}
),
200,
)