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