Fix panics if cluster is not enabled
This commit is contained in:
parent
bd46d13bcf
commit
cd58cf3df7
@ -948,7 +948,10 @@ func (a *api) start() error {
|
||||
Token: cfg.RTMP.Token,
|
||||
Logger: a.log.logger.rtmp,
|
||||
Collector: a.sessions.Collector("rtmp"),
|
||||
Proxy: a.cluster.ProxyReader(),
|
||||
}
|
||||
|
||||
if a.cluster != nil {
|
||||
config.Proxy = a.cluster.ProxyReader()
|
||||
}
|
||||
|
||||
if cfg.RTMP.EnableTLS {
|
||||
@ -977,7 +980,10 @@ func (a *api) start() error {
|
||||
Token: cfg.SRT.Token,
|
||||
Logger: a.log.logger.core.WithComponent("SRT").WithField("address", cfg.SRT.Address),
|
||||
Collector: a.sessions.Collector("srt"),
|
||||
Proxy: a.cluster.ProxyReader(),
|
||||
}
|
||||
|
||||
if a.cluster != nil {
|
||||
config.Proxy = a.cluster.ProxyReader()
|
||||
}
|
||||
|
||||
if cfg.SRT.Log.Enable {
|
||||
|
||||
@ -194,8 +194,10 @@ func NewServer(config Config) (Server, error) {
|
||||
|
||||
corsPrefixes[httpfs.Mountpoint] = config.Cors.Origins
|
||||
|
||||
if httpfs.Filesystem.Type() == "disk" || httpfs.Filesystem.Type() == "mem" {
|
||||
httpfs.Filesystem = fs.NewClusterFS(httpfs.Filesystem.Name(), httpfs.Filesystem, config.Cluster.ProxyReader())
|
||||
if config.Cluster != nil {
|
||||
if httpfs.Filesystem.Type() == "disk" || httpfs.Filesystem.Type() == "mem" {
|
||||
httpfs.Filesystem = fs.NewClusterFS(httpfs.Filesystem.Name(), httpfs.Filesystem, config.Cluster.ProxyReader())
|
||||
}
|
||||
}
|
||||
|
||||
filesystem := &filesystem{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user