Skip to content

Commit b566b4c

Browse files
authored
Merge pull request #17415 from MinaProtocol/dw/remove-unused-handler-register
Exit_handlers: remove unused method
2 parents 76dcfd8 + 0fd146d commit b566b4c

File tree

1 file changed

+2
-19
lines changed

1 file changed

+2
-19
lines changed

src/lib/exit_handlers/exit_handlers.ml

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,8 @@ open Core_kernel
44
open Async_kernel
55
open Async_unix
66

7-
(* register a thunk to be called at exit; log registration and execution *)
8-
let register_handler ~logger ~description (f : unit -> unit) =
9-
[%log info] "Registering exit handler: $description"
10-
~metadata:[ ("description", `String description) ] ;
11-
let logging_thunk () =
12-
[%log info] "Running exit handler: $description"
13-
~metadata:[ ("description", `String description) ] ;
14-
(* if there's an exception, log it, allow other handlers to run *)
15-
try f ()
16-
with exn ->
17-
[%log info] "When running exit handler: $description, got exception $exn"
18-
~metadata:
19-
[ ("description", `String description)
20-
; ("exn", `String (Exn.to_string exn))
21-
]
22-
in
23-
Stdlib.at_exit logging_thunk
24-
25-
(* register a Deferred.t thunk to be called at Async shutdown; log registration and execution *)
7+
(* register a Deferred.t thunk to be called at Async shutdown; log registration
8+
and execution *)
269
let register_async_shutdown_handler ~logger ~description
2710
(f : unit -> unit Deferred.t) =
2811
[%log debug] "Registering async shutdown handler: $description"

0 commit comments

Comments
 (0)