]> granicus.if.org Git - ejabberd/commitdiff
Improve RPC calls in mod_configure
authorEvgeny Khramtsov <ekhramtsov@process-one.net>
Wed, 17 Jul 2019 17:51:33 +0000 (20:51 +0300)
committerEvgeny Khramtsov <ekhramtsov@process-one.net>
Wed, 17 Jul 2019 17:51:33 +0000 (20:51 +0300)
src/mod_configure.erl

index a413b69ac60f98f7a467108e5255350b75065554..0e0151cdaa8ce8ced2576292b1a3d9e3ef75c9b6 100644 (file)
@@ -1135,7 +1135,9 @@ set_form(_From, _Host,
                    Txt = ?T("No 'path' found in data form"),
                    {error, xmpp:err_bad_request(Txt, Lang)};
                [String] ->
-                   case ejabberd_cluster:call(Node, mnesia, backup, [String]) of
+                   case ejabberd_cluster:call(
+                          Node, mnesia, backup, [binary_to_list(String)],
+                          timer:minutes(10)) of
                        {badrpc, Reason} ->
                            ?ERROR_MSG("RPC call mnesia:backup(~s) to node ~s "
                                       "failed: ~p", [String, Node, Reason]),
@@ -1166,8 +1168,9 @@ set_form(_From, _Host,
                    Txt = ?T("No 'path' found in data form"),
                    {error, xmpp:err_bad_request(Txt, Lang)};
                [String] ->
-                   case ejabberd_cluster:call(Node, ejabberd_admin,
-                                              restore, [String]) of
+                   case ejabberd_cluster:call(
+                          Node, ejabberd_admin, restore,
+                          [String], timer:minutes(10)) of
                        {badrpc, Reason} ->
                            ?ERROR_MSG("RPC call ejabberd_admin:restore(~s) to node "
                                       "~s failed: ~p", [String, Node, Reason]),
@@ -1198,8 +1201,9 @@ set_form(_From, _Host,
                    Txt = ?T("No 'path' found in data form"),
                    {error, xmpp:err_bad_request(Txt, Lang)};
                [String] ->
-                   case ejabberd_cluster:call(Node, ejabberd_admin,
-                                              dump_to_textfile, [String]) of
+                   case ejabberd_cluster:call(
+                          Node, ejabberd_admin, dump_to_textfile,
+                          [String], timer:minutes(10)) of
                        {badrpc, Reason} ->
                            ?ERROR_MSG("RPC call ejabberd_admin:dump_to_textfile(~s) "
                                       "to node ~s failed: ~p", [String, Node, Reason]),