1
0
mirror of https://github.com/UzixLS/migresia.git synced 2025-07-19 07:11:28 +03:00

Adding a wait for tables call to avoid failure to execute if the DB is taking a while to load due to size.

This commit is contained in:
Christopher Phillips
2014-02-06 09:24:04 -05:00
parent a586545a2f
commit 4ac5dbd21d

View File

@ -58,6 +58,8 @@ migrate(App) ->
ok ->
case migresia_migrations:ensure_schema_table_exists() of
ok ->
io:format("Waiting for tables (max timeout 2 minutes)...", []),
ok = mnesia:wait_for_tables(mnesia:system_info(tables), 120000),
rpc:multicall(migresia_migrations, list_unapplied_ups, [App]), %Basically just to ensure everybody has loaded all the migrations, which is necessary in distributed Mnesia transforms.
Loaded = migresia_migrations:list_unapplied_ups(App),
lists:foreach(fun execute_up/1, Loaded);