diff --git a/config/config.go b/config/config.go index 487a1188b..80b68e79b 100644 --- a/config/config.go +++ b/config/config.go @@ -52,4 +52,6 @@ var ImportIPFSGatewayURLs []*url.URL var ImportArweaveGatewayURLs []*url.URL +var StorageFallbackURLs map[string]string + var HTTPInternalAddress string diff --git a/main.go b/main.go index 93b466b82..960fe2fac 100644 --- a/main.go +++ b/main.go @@ -179,10 +179,11 @@ func main() { glog.Warning("DEPRECATION NOTICE: mist-user and mist-password are no longer used and will be removed in a later version") } - // TODO: I don't love the global variables for these + // TODO: I don't love the global variables for these. Me neither. config.ImportIPFSGatewayURLs = cli.ImportIPFSGatewayURLs config.ImportArweaveGatewayURLs = cli.ImportArweaveGatewayURLs config.HTTPInternalAddress = cli.HTTPInternalAddress + config.StorageFallbackURLs = cli.StorageFallbackURLs var ( metricsDB *sql.DB @@ -227,7 +228,7 @@ func main() { } // Start the "co-ordinator" that determines whether to send jobs to the Catalyst transcoding pipeline // or an external one - vodEngine, err := pipeline.NewCoordinator(pipeline.Strategy(cli.VodPipelineStrategy), cli.SourceOutput, cli.ExternalTranscoder, statusClient, metricsDB, vodDecryptPrivateKey, cli.StorageFallbackURLs, cli.BroadcasterURL, cli.SourcePlaybackHosts, c2) + vodEngine, err := pipeline.NewCoordinator(pipeline.Strategy(cli.VodPipelineStrategy), cli.SourceOutput, cli.ExternalTranscoder, statusClient, metricsDB, vodDecryptPrivateKey, cli.BroadcasterURL, cli.SourcePlaybackHosts, c2) if err != nil { glog.Fatalf("Error creating VOD pipeline coordinator: %v", err) } diff --git a/pipeline/coordinator.go b/pipeline/coordinator.go index eaad9178d..2e280ef95 100644 --- a/pipeline/coordinator.go +++ b/pipeline/coordinator.go @@ -168,16 +168,11 @@ type Coordinator struct { MetricsDB *sql.DB InputCopy clients.InputCopier VodDecryptPrivateKey *rsa.PrivateKey - StorageFallbackURLs map[string]string SourceOutputURL *url.URL C2PA *c2pa.C2PA } -func NewCoordinator( - strategy Strategy, sourceOutputURL, extTranscoderURL string, statusClient clients.TranscodeStatusClient, - metricsDB *sql.DB, VodDecryptPrivateKey *rsa.PrivateKey, storageFallbackURLs map[string]string, broadcasterURL string, - sourcePlaybackHosts map[string]string, c2pa *c2pa.C2PA) (*Coordinator, error) { - +func NewCoordinator(strategy Strategy, sourceOutputURL, extTranscoderURL string, statusClient clients.TranscodeStatusClient, metricsDB *sql.DB, VodDecryptPrivateKey *rsa.PrivateKey, broadcasterURL string, sourcePlaybackHosts map[string]string, c2pa *c2pa.C2PA) (*Coordinator, error) { if !strategy.IsValid() { return nil, fmt.Errorf("invalid strategy: %s", strategy) } @@ -210,14 +205,12 @@ func NewCoordinator( Broadcaster: broadcaster, probe: video.Probe{}, sourcePlaybackHosts: sourcePlaybackHosts, - storageFallbackURLs: storageFallbackURLs, }, pipeExternal: &external{extTranscoder}, Jobs: cache.New[*JobInfo](), MetricsDB: metricsDB, InputCopy: clients.NewInputCopy(), VodDecryptPrivateKey: VodDecryptPrivateKey, - StorageFallbackURLs: storageFallbackURLs, SourceOutputURL: sourceOutput, C2PA: c2pa, }, nil diff --git a/pipeline/ffmpeg.go b/pipeline/ffmpeg.go index 2011f5343..6a37220fd 100644 --- a/pipeline/ffmpeg.go +++ b/pipeline/ffmpeg.go @@ -30,7 +30,6 @@ type ffmpeg struct { Broadcaster clients.BroadcasterClient probe video.Prober sourcePlaybackHosts map[string]string - storageFallbackURLs map[string]string } func init() {