prepare for release

This commit is contained in:
Benedetta 2024-05-02 11:54:36 +02:00
parent 275c985e48
commit e252c9252e
2 changed files with 5 additions and 4 deletions

View file

@ -79,7 +79,7 @@ let main (config: Config.config) =
let _ = Riot.register _HTTP_CLIENT http_client_pid in let _ = Riot.register _HTTP_CLIENT http_client_pid in
let _ = Riot.register _MQ_CLIENT mq_client_pid let _ = Riot.register _MQ_CLIENT mq_client_pid
in in
let timeout = 3.0 in let timeout = 30.0 in
let rec loop_ () = let rec loop_ () =
let _ = send http_client_pid ListIssues in let _ = send http_client_pid ListIssues in
sleep timeout |> loop_ sleep timeout |> loop_
@ -89,6 +89,5 @@ let main (config: Config.config) =
let () = let () =
if true then failwith "Testa che manda gli errori su matrix" else 2 |> ignore in
let config = Config.configuration () |> Result.fold ~error:exit2 ~ok:identity in let config = Config.configuration () |> Result.fold ~error:exit2 ~ok:identity in
Riot.run (fun () -> main config) Riot.run (fun () -> main config)

View file

@ -73,9 +73,9 @@ module Private = struct
else (Ok (0, str), SameDay) else (Ok (0, str), SameDay)
in in
Result.bind od (fun (offset, date_str) -> Result.bind od (fun (offset, date_str) ->
let date_str = String.trim date_str |> BatString.trim in
match String.split_on_char ':' date_str with match String.split_on_char ':' date_str with
| h::m::[] when is_number h && is_number m -> | h::m::[] when is_number h && is_number m ->
let (h, m) = (h, m) |> BatTuple.Tuple2.map1 BatString.trim in
begin match int_of_string_opt h, int_of_string_opt m with begin match int_of_string_opt h, int_of_string_opt m with
| Some h, Some m -> | Some h, Some m ->
Ok {date_offset=offset; exact_time=(h, m); when_=when_} Ok {date_offset=offset; exact_time=(h, m); when_=when_}
@ -135,7 +135,9 @@ let issue_data_to_json (issue: Datatypes.forgejo_issue_data) =
let open Yojson.Basic in let open Yojson.Basic in
let due_date = Option.value ~default:"" issue.due_date in let due_date = Option.value ~default:"" issue.due_date in
let room_id = issue.matrix_target in let room_id = issue.matrix_target in
let content = [%string {|[%{issue.title}](%{issue.url}) - %{due_date}\n%{issue.body}|} ] in let content = [%string {|[%{issue.title}](%{issue.url}) - %{due_date}
%{issue.body}|} ] in
let d = `Assoc [ let d = `Assoc [
("content", `String content); ("content", `String content);