MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / queue_sync_request

Function queue_sync_request

modules/clusterer/sync.c:94–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92}
93
94int queue_sync_request(cluster_info_t *cluster, struct local_cap *lcap)
95{
96 lock_get(cluster->lock);
97 lcap->flags |= CAP_SYNC_PENDING;
98 if (sr_get_core_status() == STATE_INITIALIZING)
99 lcap->flags |= CAP_SYNC_STARTUP;
100 else
101 lcap->flags &= ~CAP_SYNC_STARTUP;
102
103 if (cluster->current_node->flags & NODE_IS_SEED)
104 gettimeofday(&lcap->sync_req_time, NULL);
105
106 lock_release(cluster->lock);
107
108 LM_INFO("Queue'ing sync request for capability '%.*s' in cluster %d "
109 "(no donor available)\n", lcap->reg.name.len, lcap->reg.name.s,
110 cluster->cluster_id);
111
112 sr_set_status(cl_srg, STR2CI(lcap->reg.sr_id), CAP_SR_SYNC_PENDING,
113 STR2CI(CAP_SR_STATUS_STR(CAP_SR_SYNC_PENDING)), 0);
114 if (sr_add_report_fmt(cl_srg, STR2CI(lcap->reg.sr_id), 0,
115 "Sync request postponed! (no donor available)"))
116 return -1;
117
118 return 0;
119}
120
121int cl_request_sync(str *capability, int cluster_id, int from_cb)
122{

Callers 1

cl_request_syncFunction · 0.85

Calls 5

lock_getFunction · 0.85
sr_get_core_statusFunction · 0.85
lock_releaseFunction · 0.85
sr_set_statusFunction · 0.85
sr_add_report_fmtFunction · 0.85

Tested by

no test coverage detected