Skip to content

Commit

Permalink
Merge pull request #398 from shonfeder/update-for-cohttp-6
Browse files Browse the repository at this point in the history
Update for cohttp 6 Response API
  • Loading branch information
shonfeder authored Nov 29, 2024
2 parents 29c20bb + 6f874c2 commit d9b58b7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Dockerfile.web
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM ocaml/opam:debian-12-ocaml-4.14 AS build
RUN sudo ln -f /usr/bin/opam-2.1 /usr/bin/opam && opam init --reinit -ni
RUN sudo apt-get update && sudo apt-get install libev-dev capnproto m4 pkg-config libgmp-dev libffi-dev -y --no-install-recommends
RUN cd ~/opam-repository && git fetch origin master && git reset --hard 2dff29abd6cda0706f80503db11dd4af4e7db559 && opam update
RUN cd ~/opam-repository && git fetch origin master && git reset --hard 65a1519b6d82a358204a1a33b6d84821d56da6bd && opam update
COPY --chown=opam opam-repo-ci-api.opam opam-repo-ci-web.opam opam-repo-ci-service.opam opam-ci-check.opam /src/
WORKDIR /src
RUN opam install -y --deps-only .
Expand Down
2 changes: 1 addition & 1 deletion opam-repo-ci-web.opam
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ depends: [
"prometheus-app"
"cmdliner" {>= "1.1.0"}
"lwt"
"cohttp-lwt-unix" {>= "2.2.0"}
"cohttp-lwt-unix" {>= "6.0.0"}
"mirage-crypto-rng" {>= "0.11.0"}
"tyxml"
"capnp-rpc-unix"
Expand Down
5 changes: 2 additions & 3 deletions web-ui/github.ml
Original file line number Diff line number Diff line change
Expand Up @@ -283,10 +283,9 @@ module Repo_handle = struct
(* Otherwise, an nginx reverse proxy will wait for the whole log before sending anything. *)
Cohttp.Header.init_with "X-Accel-Buffering" "no"
in
let res = Cohttp.Response.make ~status:`OK ~flush:true ~encoding:Cohttp.Transfer.Chunked ~headers () in
let res = Cohttp.Response.make ~status:`OK ~encoding:Cohttp.Transfer.Chunked ~headers () in
let write _ic oc =
let flush = Cohttp.Response.flush res in
let writer = Transfer_IO.make_writer ~flush Cohttp.Transfer.Chunked oc in
let writer = Transfer_IO.make_writer ~flush:true Cohttp.Transfer.Chunked oc in
Lwt.finalize
(fun () ->
stream_logs job ~owner ~name ~refs ~hash ~variant ~status chunk writer >>= fun () ->
Expand Down

0 comments on commit d9b58b7

Please sign in to comment.