add sync_error_id_to_str rpc

This commit is contained in:
caixiangyue 2019-10-16 17:53:16 +08:00
parent 0abf6b8528
commit e59f55b5f4
4 changed files with 20 additions and 1 deletions

View File

@ -16,7 +16,7 @@
#include "common/mq-mgr.h"
#include "seafile-config.h"
#include "seafile-object.h"
#include "seafile-error-impl.h"
#define DEBUG_FLAG SEAFILE_DEBUG_OTHER
#include "log.h"
@ -1047,3 +1047,9 @@ seafile_shutdown (GError **error)
exit(0);
return 0;
}
char*
seafile_sync_error_id_to_str (int error_id, GError **error)
{
return g_strdup(sync_error_id_to_str (error_id));
}

View File

@ -79,6 +79,11 @@ register_rpc_service ()
searpc_create_service ("seafile-threaded-rpcserver");
/* seafile-rpcserver */
searpc_server_register_function ("seafile-rpcserver",
seafile_sync_error_id_to_str,
"seafile_sync_error_id_to_str",
searpc_signature_string__int());
searpc_server_register_function ("seafile-rpcserver",
seafile_get_session_info,
"seafile_get_session_info",

View File

@ -231,4 +231,7 @@ json_t * seafile_get_sync_notification (GError **error);
int
seafile_shutdown (GError **error);
char*
seafile_sync_error_id_to_str (int error_id, GError **error);
#endif

View File

@ -13,6 +13,11 @@ class SeafileRpcClient(NamedPipeClient):
**kwargs
)
@searpc_func("string", ["int"])
def seafile_sync_error_id_to_str():
pass
sync_error_id_to_str = seafile_sync_error_id_to_str
@searpc_func("object", [])
def seafile_get_session_info():
pass