mirror of
https://github.com/haiwen/seafile-server.git
synced 2025-08-31 23:19:36 +00:00
add rpc publish_event() , pop_event() and remove cevent (#253)
This commit is contained in:
committed by
Jiaqiang Xu
parent
b85d194b4b
commit
aa0185203b
@@ -14,6 +14,7 @@
|
||||
#include "repo-mgr.h"
|
||||
#include "seafile-error.h"
|
||||
#include "seafile-rpc.h"
|
||||
#include "mq-mgr.h"
|
||||
|
||||
#ifdef SEAFILE_SERVER
|
||||
#include "web-accesstoken-mgr.h"
|
||||
@@ -233,6 +234,31 @@ seafile_restore_repo_from_trash (const char *repo_id, GError **error)
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
seafile_publish_event(const char *channel, const char *content, GError **error)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
if (!channel || !content) {
|
||||
g_set_error (error, SEAFILE_DOMAIN, SEAF_ERR_BAD_ARGS, "Argument should not be null");
|
||||
return -1;
|
||||
}
|
||||
|
||||
ret = publish_event (seaf->mq_mgr, channel, content);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
char*
|
||||
seafile_pop_event(const char *channel, GError **error)
|
||||
{
|
||||
if (!channel) {
|
||||
g_set_error (error, SEAFILE_DOMAIN, SEAF_ERR_BAD_ARGS, "Argument should not be null");
|
||||
return NULL;
|
||||
}
|
||||
return pop_event (seaf->mq_mgr, channel);
|
||||
}
|
||||
#endif
|
||||
|
||||
GList*
|
||||
|
Reference in New Issue
Block a user