Skip to content

Commit

Permalink
Merge branch 'update/increase-vip-fs-timeouts' into fix/mem-usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Adirael committed May 10, 2024
2 parents 7a239f3 + 33ec8f7 commit 2e081bc
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions files/class-api-client.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,21 @@ public function get_file( $file_path ) {
return $file;
}

// calculate timeout
$info = array();
$this->is_file( $file_path, $info );
if ( is_wp_error( $info ) ) {
return $info;
}

$request_timeout = $this->calculate_upload_timeout( $info['size'] );
$tmp_file = $this->cache->create_tmp_file();

// Request args for wp_remote_request()
$request_args = [
'stream' => true,
'filename' => $tmp_file,
'timeout' => $request_timeout,
];

// not in cache so get from API
Expand Down

0 comments on commit 2e081bc

Please sign in to comment.