~glhrmfrts/utos-usr-local-hcs-exam-ecg-storage-pgsql

bb0bda14dd407050af69b814283d2063f5d86731 — Guilherme Nemeth 8 months ago 66b8513 + fad5191
merge with upstream
M .gitignore => .gitignore +2 -1
@@ 18,4 18,5 @@ _build
rebar3.crashdump
*~
rebar.lock
Dockerfile
\ No newline at end of file
Dockerfile
etc

M rebar.config => rebar.config +1 -1
@@ 1,7 1,7 @@
{erl_opts, [debug_info]}.
{deps, [
        {jsx, {git, "https://github.com/talentdeficit/jsx", {tag, "v3.0.0"}}},
        {utfsc, {git, "https://git.sr.ht/~umgeher/utfsc", {tag, "1.6.1"}}},
        {utfsc, {git, "https://git.sr.ht/~umgeher/utfsc", {tag, "1.7.0"}}},
        {utos_actor, {git, "https://git.sr.ht/~umgeher/utos-actor", {tag, "0.3.1"}}},
        {utos_crypto, {git, "https://git.sr.ht/~umgeher/utos-crypto", {tag, "0.2.0"}}},
        {utos_datetime, {git, "https://git.sr.ht/~umgeher/utos-datetime", {tag, "0.3.3"}}},

M src/utos_usr_local_hcs_exam_ecg_storage_pgsql.erl => src/utos_usr_local_hcs_exam_ecg_storage_pgsql.erl +1 -1
@@ 41,4 41,4 @@ table_name_ecg(<<UID/binary>>) ->
    utos_crypto:sha256({hex, ["exam-ecg:", UID]}).

utfsc() ->
    utos_actor:call(utos_usr_local_hcs_exam_ecg_storage_pgsql_utfsc, io).
\ No newline at end of file
    utos_actor:call(utos_usr_local_hcs_exam_ecg_storage_pgsql_utfsc, io).

M src/utos_usr_local_hcs_exam_ecg_storage_pgsql_settings.erl => src/utos_usr_local_hcs_exam_ecg_storage_pgsql_settings.erl +6 -1
@@ 12,7 12,12 @@ federation_realm() ->
    utos_usr_federation:settings_realm().

pgsql() ->
    utos_etc:read(<<"utos-usr-local-hcs-exam-ecg-storage-pgsql-pgsql">>, none).
    utos_etc:read(<<"utos-usr-local-hcs-exam-ecg-storage-pgsql-pgsql">>,
                  #{
                    host => "localhost", port => 5432, username => "hcs_user",
                    password => "password", database => "hcs", timeout => 50000,
                    codecs => []
                   }).

pgsql(Map) ->
    utos_etc:set(<<"utos-usr-local-hcs-exam-ecg-storage-pgsql-pgsql">>, Map).

M src/utos_usr_local_hcs_exam_ecg_storage_pgsql_sup.erl => src/utos_usr_local_hcs_exam_ecg_storage_pgsql_sup.erl +2 -10
@@ 17,19 17,11 @@ init([]) ->
    SupFlags = #{strategy => one_for_all,
                 intensity => 0,
                 period => 1},
    {ok, PGSettings} = utos_usr_local_hcs_exam_ecg_storage_pgsql:settings_pgsql(),
    {ok, Host} = utos_usr_local_hcs_exam_ecg_storage_pgsql:settings_utfsc_host(),
    {ok, Port} = utos_usr_local_hcs_exam_ecg_storage_pgsql:settings_utfsc_port(),
    DB = #{
        host => "localhost",
        port => 5432,
        username => "hcs_user",
        password => "password",
        database => "hcs",
        timeout => 50000,
        codecs => []
    },
    ChildSpecs = [
                  {pgsql, {utos_usr_db_postgresql_pool, start_link, [{local, utos_usr_local_hcs_exam_ecg_storage_pgsql_pool}, DB]},
                  {pgsql, {utos_usr_db_postgresql_pool, start_link, [{local, utos_usr_local_hcs_exam_ecg_storage_pgsql_pool}, PGSettings]},
                   permanent, 5000, worker, [utos_usr_local_hcs_exam_ecg_storage_pgsql_pool]},
                  {utfsc, {utfsc_server, start_link, [utos_usr_local_hcs_exam_ecg_storage_pgsql_utfsc, Host, Port]},
                   permanent, 5000, worker, [utos_usr_local_hcs_exam_ecg_storage_pgsql_utfsc]}