Skip to content

Commit 1f9a55d

Browse files
committed
Concurrency bad
1 parent 98e3594 commit 1f9a55d

File tree

2 files changed

+3
-23
lines changed

2 files changed

+3
-23
lines changed

pegasus/lib/repository.ml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -645,12 +645,9 @@ let import_car t (stream : Car.stream) : (t, exn) Lwt_result.t =
645645
let$! () = User_store.Bulk.put_blocks mst_blocks conn in
646646
let$! () =
647647
[%rapper execute {sql| DELETE FROM records |sql}] () conn
648-
in
649-
let$!* _ =
650-
Lwt.all
651-
[ User_store.Bulk.put_records record_data conn
652-
; User_store.Bulk.put_blob_refs !blob_refs conn ]
653-
in
648+
in
649+
let$! () = User_store.Bulk.put_records record_data conn in
650+
let$! () = User_store.Bulk.put_blob_refs !blob_refs conn in
654651
Lwt.return_ok () ) )
655652
in
656653
(* clear cached block_map so it's rebuilt on next access *)

pegasus/lib/util.ml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -33,23 +33,6 @@ module Syntax = struct
3333
let ( let$! ) m f =
3434
match%lwt m with Ok x -> f x | Error e -> raise (Caqti_error.Exn e)
3535

36-
(* let$! but for an array of results *)
37-
let ( let$!* ) m f =
38-
let%lwt results =
39-
match%lwt m with
40-
| xs ->
41-
Lwt.return @@ List.rev
42-
@@ List.fold_left
43-
(fun acc x ->
44-
match x with
45-
| Ok x ->
46-
x :: acc
47-
| Error e ->
48-
raise (Caqti_error.Exn e) )
49-
[] xs
50-
in
51-
f results
52-
5336
(* unwraps an Lwt result, raising an exception if there's an error *)
5437
let ( >$! ) m f =
5538
match%lwt m with

0 commit comments

Comments
 (0)