save works

This commit is contained in:
Rongsong Shen 2026-02-28 17:55:50 +08:00
parent b1faeb94b6
commit b748e30d20
35 changed files with 1247 additions and 2149 deletions

View file

@ -47,10 +47,11 @@ int get_ep_role(endpoint_t* ep)
return priv->role;
}
worker_t* get_ep_worker(cluster_t* c, endpoint_t* ep, int op)
worker_t* get_ep_worker(cluster_t* c, endpoint_t* ep)
{
int role, idx;
worker_t* w = NULL;
worker_t* w = NULL;
int rc = 0;
role = get_ep_role(ep);
if (role != HostRole_worker) {
@ -64,7 +65,11 @@ worker_t* get_ep_worker(cluster_t* c, endpoint_t* ep, int op)
return NULL;
}
w = workermgr_lock_byid(&(c->workermgr), idx, op);
rc = key_find(c->workermgr, (void*)idx, (void**)&w);
if (rc < 0) {
return NULL;
}
if (w == NULL) {
ERROR("can not find worker with id (%d)", idx);
}