From 19611409cfd2eb2b733705044d844aa2d19c5069 Mon Sep 17 00:00:00 2001 From: Marcos Magueta Date: Wed, 12 Nov 2025 00:23:20 -0300 Subject: fix startup crash --- src/main.erl | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) (limited to 'src/main.erl') diff --git a/src/main.erl b/src/main.erl index 3c34a31..5b8d6e3 100644 --- a/src/main.erl +++ b/src/main.erl @@ -1,7 +1,26 @@ -module(main). --export([fibonacci/1]). +-behaviour(application). + +-export([start/2, stop/1]). + +start(_StartType, _StartArgs) -> + %% Start Mnesia (or other children) here + io:format("Starting app...~n"), + + %% Ensure Mnesia is started + mnesia:start(), + + {ok, self()}. + +stop(_State) -> + io:format("Stopping app...~n"), + ok. + +%% setup() -> +%% mnesia:create_table(attributes, [{type, set}, +%% {attributes, [name, value, type]}, +%% {ram_copies, [node()]}, +%% {index, [name]} +%% ]). + -fibonacci(0) -> 0; -fibonacci(1) -> 1; -fibonacci(N) -> - fibonacci(N-2) + fibonacci(N-1). -- cgit v1.2.3