#2040 - curl errors on upload to hub - fixes and upload parameters changes
This commit is contained in:
parent
6c751954ee
commit
657d7c2ab5
|
@ -1422,8 +1422,14 @@ class BasicStor extends Alib {
|
||||||
if (!file_exists($metadata)) {
|
if (!file_exists($metadata)) {
|
||||||
$metadata = NULL;
|
$metadata = NULL;
|
||||||
}
|
}
|
||||||
$r = $this->bsExistsFile($gunid, NULL, TRUE);
|
$exists = $this->bsExistsFile($gunid, NULL, TRUE);
|
||||||
if (!PEAR::isError($res) && !$r) {
|
if( $exists ) {
|
||||||
|
$res = $this->idFromGunid($gunid);
|
||||||
|
if (!PEAR::isError($res)) {
|
||||||
|
$res = $this->bsDeleteFile($res, TRUE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!PEAR::isError($res) ) {
|
||||||
$res = $this->bsPutFile($parid, $gunid, $rawMedia, $metadata,
|
$res = $this->bsPutFile($parid, $gunid, $rawMedia, $metadata,
|
||||||
$gunid, 'audioclip'
|
$gunid, 'audioclip'
|
||||||
);
|
);
|
||||||
|
|
|
@ -83,10 +83,10 @@ class Transport
|
||||||
private $cronJobScript;
|
private $cronJobScript;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* wget --timeout parameter [s]
|
* wget --read-timeout parameter [s]
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
private $downTimeout = 20; // 600
|
private $downTimeout = 900;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* wget --waitretry parameter [s]
|
* wget --waitretry parameter [s]
|
||||||
|
@ -109,19 +109,19 @@ class Transport
|
||||||
* curl --max-time parameter
|
* curl --max-time parameter
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
private $upTrMaxTime = 600;
|
private $upTrMaxTime = 1800;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* curl --speed-time parameter
|
* curl --speed-time parameter
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
private $upTrSpeedTime = 20;
|
private $upTrSpeedTime = 30;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* curl --speed-limit parameter
|
* curl --speed-limit parameter
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
private $upTrSpeedLimit = 500;
|
private $upTrSpeedLimit = 30;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* curl --connect-timeout parameter
|
* curl --connect-timeout parameter
|
||||||
|
@ -195,6 +195,13 @@ class Transport
|
||||||
$res['realsize'] = filesize($trec->row['localfile']);
|
$res['realsize'] = filesize($trec->row['localfile']);
|
||||||
$res['realsum'] = $this->_chsum($trec->row['localfile']);
|
$res['realsum'] = $this->_chsum($trec->row['localfile']);
|
||||||
}
|
}
|
||||||
|
if ( ($trec->row['direction'] == 'up') ){
|
||||||
|
$check = $this->uploadCheck($trec->row['pdtoken']);
|
||||||
|
if (!PEAR::isError($check)) {
|
||||||
|
$res['realsize'] = $check['size'];
|
||||||
|
$res['realsum'] = $check['realsum'];
|
||||||
|
}
|
||||||
|
}
|
||||||
// do not return finished on finished search job upload
|
// do not return finished on finished search job upload
|
||||||
// - whole search is NOT finished
|
// - whole search is NOT finished
|
||||||
if ($res['trtype'] == "searchjob" && $res['direction'] == "up" && $res['state'] == "finished") {
|
if ($res['trtype'] == "searchjob" && $res['direction'] == "up" && $res['state'] == "finished") {
|
||||||
|
@ -1110,9 +1117,9 @@ class Transport
|
||||||
}
|
}
|
||||||
$res = system($command, $status);
|
$res = system($command, $status);
|
||||||
// status 18 - Partial file. Only a part of the file was transported.
|
// status 18 - Partial file. Only a part of the file was transported.
|
||||||
if ($status == 0 || $status == 18) {
|
// status 28 - Timeout. Too long/slow upload, try to resume next time rather.
|
||||||
// status 28 - timeout
|
// if ($status == 0 || $status == 18) {
|
||||||
// if ($status == 0 || $status == 18 || $status == 28) {
|
if ($status == 0 || $status == 18 || $status == 28) {
|
||||||
$check = $this->uploadCheck($row['pdtoken']);
|
$check = $this->uploadCheck($row['pdtoken']);
|
||||||
if (PEAR::isError($check)) {
|
if (PEAR::isError($check)) {
|
||||||
return $check;
|
return $check;
|
||||||
|
@ -1174,7 +1181,7 @@ class Transport
|
||||||
$url = escapeshellarg($row['url']);
|
$url = escapeshellarg($row['url']);
|
||||||
$command =
|
$command =
|
||||||
"wget -q -c".
|
"wget -q -c".
|
||||||
" --timeout={$this->downTimeout}".
|
" --read-timeout={$this->downTimeout}".
|
||||||
" --waitretry={$this->downWaitretry}".
|
" --waitretry={$this->downWaitretry}".
|
||||||
" -t {$this->downRetries}".
|
" -t {$this->downRetries}".
|
||||||
(!is_null($this->downLimitRate)?
|
(!is_null($this->downLimitRate)?
|
||||||
|
|
Loading…
Reference in New Issue