]> granicus.if.org Git - ejabberd/commitdiff
Transform ejabberd_commands on the start
authorEvgeniy Khramtsov <ekhramtsov@process-one.net>
Sat, 19 Nov 2016 10:05:13 +0000 (13:05 +0300)
committerEvgeniy Khramtsov <ekhramtsov@process-one.net>
Sat, 19 Nov 2016 10:05:13 +0000 (13:05 +0300)
src/ejabberd_commands.erl

index 8d74ad5a20fbd0d7567a4d159fa9551b141807c7..6172b18ed62e5f3fa41769874c6d6f4cdf988174 100644 (file)
@@ -277,6 +277,10 @@ get_commands_spec() ->
                            args_example = ["/home/me/docs/api.html", "mod_admin", "java,json"],
                            result_example = ok}].
 init() ->
+    try mnesia:transform_table(ejabberd_commands, ignore,
+                              record_info(fields, ejabberd_commands))
+    catch exit:{aborted, {no_exists, _}} -> ok
+    end,
     mnesia:create_table(ejabberd_commands,
                         [{ram_copies, [node()]},
                          {local_content, true},