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,
|
||||
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,9 +194,11 @@ func NewServer(config Config) (Server, error) {
|
||||
|
||||
corsPrefixes[httpfs.Mountpoint] = config.Cors.Origins
|
||||
|
||||
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{
|
||||
FS: httpfs,
|
||||
|
Reference in New Issue
Block a user