mirror of
https://github.com/ente-io/ente.git
synced 2025-08-08 07:28:26 +00:00
make replication.worker-url optional
This commit is contained in:
parent
de36d1f9fb
commit
81b07e772d
@ -317,7 +317,7 @@ internal:
|
||||
replication:
|
||||
enabled: false
|
||||
# The Cloudflare worker to use to download files from the primary hot
|
||||
# bucket. Must be specified if replication is enabled.
|
||||
# bucket. If this isn't specified, files will be downloaded directly.
|
||||
worker-url:
|
||||
# Number of go routines to spawn for replication
|
||||
# This is not related to the worker-url above.
|
||||
|
@ -87,10 +87,11 @@ func (c *ReplicationController3) StartReplication() error {
|
||||
|
||||
workerURL := viper.GetString("replication.worker-url")
|
||||
if workerURL == "" {
|
||||
return fmt.Errorf("replication.worker-url was not defined")
|
||||
log.Infof("replication.worker-url was not defined, files will downloaded directly during replication")
|
||||
} else {
|
||||
log.Infof("Worker URL to download objects for replication v3 is: %s", workerURL)
|
||||
}
|
||||
c.workerURL = workerURL
|
||||
log.Infof("Worker URL to download objects for replication v3 is: %s", workerURL)
|
||||
|
||||
c.createMetrics()
|
||||
err := c.createTemporaryStorage()
|
||||
@ -414,7 +415,7 @@ func (c *ReplicationController3) downloadFromB2ViaWorker(objectKey string, file
|
||||
q.Add("src", presignedEncodedURL)
|
||||
request.URL.RawQuery = q.Encode()
|
||||
|
||||
if c.S3Config.AreLocalBuckets() {
|
||||
if c.S3Config.AreLocalBuckets() || c.workerURL == "" {
|
||||
originalURL := request.URL
|
||||
request, err = http.NewRequest("GET", presignedURL, nil)
|
||||
if err != nil {
|
||||
|
Loading…
x
Reference in New Issue
Block a user