1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

Let cluster config support overwritten by ENV

This commit is contained in:
Jacob Su 2024-07-16 17:18:53 +08:00
parent d220bf280e
commit 28074bd95a
5 changed files with 163 additions and 18 deletions

View file

@ -714,7 +714,9 @@ srs_error_t SrsRtmpConn::playing(SrsSharedPtr<SrsLiveSource> source)
// When origin cluster enabled, try to redirect to the origin which is active.
// A active origin is a server which is delivering stream.
if (!info->edge && _srs_config->get_vhost_origin_cluster(req->vhost) && source->inactive()) {
vector<string> coworkers = _srs_config->get_vhost_coworkers(req->vhost);
SrsConfDirective* conf = _srs_config->get_vhost_coworkers(req->vhost);
vector<string> coworkers = conf ? conf->args : vector<string>();
for (int i = 0; i < (int)coworkers.size(); i++) {
// TODO: FIXME: User may config the server itself as coworker, we must identify and ignore it.
string host; int port = 0; string coworker = coworkers.at(i);