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

Update for cohttp 6 Response API #398

Merged
merged 1 commit into from
Nov 29, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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