Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-cloud-platform/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails ActiveStorage大文件上传触发Google::Execution::Expired_Ruby On Rails_Google Cloud Platform_Rails Activestorage - Fatal编程技术网

Ruby on rails ActiveStorage大文件上传触发Google::Execution::Expired

Ruby on rails ActiveStorage大文件上传触发Google::Execution::Expired,ruby-on-rails,google-cloud-platform,rails-activestorage,Ruby On Rails,Google Cloud Platform,Rails Activestorage,在工作中实现ActiveStorage时,我们发现在上载12GB的大文件时,操作会挂起大约10分钟,并且出现错误Google::Execution::Expired或有时HTTPClient::SendTimeoutError:Execution Expired 我运行的大多数上传都是这样一行: backup.file.attach(io:file.open(“/my/file/path.ext”),文件名:“myfilename”) 有没有办法使请求持续更长时间,或者有没有办法循环此超时 到目

在工作中实现ActiveStorage时,我们发现在上载12GB的大文件时,操作会挂起大约10分钟,并且出现错误
Google::Execution::Expired
或有时
HTTPClient::SendTimeoutError:Execution Expired

我运行的大多数上传都是这样一行:

backup.file.attach(io:file.open(“/my/file/path.ext”),文件名:“myfilename”)

有没有办法使请求持续更长时间,或者有没有办法循环此超时


到目前为止,这一策略对于4GB的上传效果良好。只是当我对文件大小太过火时,才会发生这种情况。时间对我们来说不是问题,因为这是Cron作业的夜间任务。

谷歌云存储客户端的发送超时默认为1分钟左右。(您会看到10分钟的延迟,因为客户端在遇到超时后多次尝试恢复上载。)您可以在
config/storage.yml
中以秒为单位指定不同的超时:

production:
  service: GCS
  credentials: { ... }
  project: my-project
  bucket: my-bucket
  timeout: 120  # 2 minutes

使用
timeout:0
禁用发送超时。

谷歌云存储客户端的发送超时默认为1分钟左右。(您会看到10分钟的延迟,因为客户端在遇到超时后多次尝试恢复上载。)您可以在
config/storage.yml
中以秒为单位指定不同的超时:

production:
  service: GCS
  credentials: { ... }
  project: my-project
  bucket: my-bucket
  timeout: 120  # 2 minutes
使用
timeout:0
禁用发送超时