Commit 76599436 authored by Bruce MacDonald's avatar Bruce MacDonald
Browse files

use head to check heartbeat

parent 40a25bf8
...@@ -225,7 +225,7 @@ func (c *Client) Delete(ctx context.Context, req *DeleteRequest) error { ...@@ -225,7 +225,7 @@ func (c *Client) Delete(ctx context.Context, req *DeleteRequest) error {
} }
func (c *Client) Heartbeat(ctx context.Context) error { func (c *Client) Heartbeat(ctx context.Context) error {
if err := c.do(ctx, http.MethodGet, "/", nil, nil); err != nil { if err := c.do(ctx, http.MethodHead, "/", nil, nil); err != nil {
return err return err
} }
return nil return nil
......
...@@ -319,6 +319,9 @@ func Serve(ln net.Listener) error { ...@@ -319,6 +319,9 @@ func Serve(ln net.Listener) error {
r.GET("/", func(c *gin.Context) { r.GET("/", func(c *gin.Context) {
c.String(http.StatusOK, "Ollama is running") c.String(http.StatusOK, "Ollama is running")
}) })
r.HEAD("/", func(c *gin.Context) {
c.Status(http.StatusOK)
})
r.POST("/api/pull", PullModelHandler) r.POST("/api/pull", PullModelHandler)
r.POST("/api/generate", GenerateHandler) r.POST("/api/generate", GenerateHandler)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment