Skip to content

Commit ada2308

Browse files
committed
ctx: allocate new hash table for every Context.make ()
1 parent 1ddbfbd commit ada2308

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

lib/context.ml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,20 @@ type t = {
1515
state : State_t.state;
1616
}
1717

18-
let default : t =
18+
let default_config_filename = "monorobot.json"
19+
20+
let default_secrets_filepath = "secrets.json"
21+
22+
let make ?config_filename ?secrets_filepath ?state_filepath () =
1923
{
20-
config_filename = "monorobot.json";
21-
secrets_filepath = "secrets.json";
22-
state_filepath = None;
24+
config_filename = Option.value config_filename ~default:default_config_filename;
25+
secrets_filepath = Option.value secrets_filepath ~default:default_secrets_filepath;
26+
state_filepath;
2327
secrets = None;
2428
config = Stringtbl.empty ();
2529
state = State.empty ();
2630
}
2731

28-
let make ?config_filename ?secrets_filepath ?state_filepath () =
29-
let config_filename = Option.value config_filename ~default:default.config_filename in
30-
let secrets_filepath = Option.value secrets_filepath ~default:default.secrets_filepath in
31-
{ default with config_filename; secrets_filepath; state_filepath }
32-
3332
let get_secrets_exn ctx =
3433
match ctx.secrets with
3534
| None -> context_error "secrets is uninitialized"

0 commit comments

Comments
 (0)