Merge "Remove FileOp batch ID"
This commit is contained in:
commit
f4a02a1c53
2 changed files with 1 additions and 27 deletions
|
|
@ -21,8 +21,6 @@
|
|||
* @ingroup FileBackend
|
||||
*/
|
||||
|
||||
use Wikimedia\Timestamp\ConvertibleTimestamp;
|
||||
|
||||
/**
|
||||
* Helper class for representing batch file operations.
|
||||
* Do not use this class from places outside FileBackend.
|
||||
|
|
@ -63,7 +61,6 @@ class FileOpBatch {
|
|||
return $status;
|
||||
}
|
||||
|
||||
$batchId = self::getTimestampedUUID();
|
||||
$ignoreErrors = !empty( $opts['force'] );
|
||||
$maxConcurrency = $opts['concurrency'] ?? 1;
|
||||
|
||||
|
|
@ -75,7 +72,6 @@ class FileOpBatch {
|
|||
// Do pre-checks for each operation; abort on failure...
|
||||
foreach ( $performOps as $index => $fileOp ) {
|
||||
$backendName = $fileOp->getBackend()->getName();
|
||||
$fileOp->setBatchId( $batchId ); // transaction ID
|
||||
// Decide if this op can be done concurrently within this sub-batch
|
||||
// or if a new concurrent sub-batch must be started after this one...
|
||||
if ( $fileOp->dependsOn( $curBatchDeps )
|
||||
|
|
@ -184,15 +180,4 @@ class FileOpBatch {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static function getTimestampedUUID() {
|
||||
// TODO: This is a leftover from FileJournal that is probably no longer needed.
|
||||
$s = '';
|
||||
for ( $i = 0; $i < 5; $i++ ) {
|
||||
$s .= mt_rand( 0, 2147483647 );
|
||||
}
|
||||
$s = Wikimedia\base_convert( sha1( $s ), 16, 36, 31 );
|
||||
$timestamp = ConvertibleTimestamp::convert( TS_MW, time() );
|
||||
return substr( Wikimedia\base_convert( $timestamp, 10, 36, 9 ) . $s, 0, 31 );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,8 +48,6 @@ abstract class FileOp {
|
|||
protected $failed = false;
|
||||
/** @var bool */
|
||||
protected $async = false;
|
||||
/** @var string */
|
||||
protected $batchId;
|
||||
/** @var bool */
|
||||
protected $cancelled = false;
|
||||
|
||||
|
|
@ -123,15 +121,6 @@ abstract class FileOp {
|
|||
return $path;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the batch UUID this operation belongs to
|
||||
*
|
||||
* @param string $batchId
|
||||
*/
|
||||
final public function setBatchId( $batchId ) {
|
||||
$this->batchId = $batchId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the value of the parameter with the given name
|
||||
*
|
||||
|
|
@ -517,7 +506,7 @@ abstract class FileOp {
|
|||
$params['failedAction'] = $action;
|
||||
try {
|
||||
$this->logger->error( static::class .
|
||||
" failed (batch #{$this->batchId}): " . FormatJson::encode( $params ) );
|
||||
" failed: " . FormatJson::encode( $params ) );
|
||||
} catch ( Exception $e ) {
|
||||
// bad config? debug log error?
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue