Merge "Remove on-demand update of img_sha1"
This commit is contained in:
commit
dfde3e099b
1 changed files with 0 additions and 17 deletions
|
|
@ -2638,23 +2638,6 @@ class LocalFile extends File {
|
|||
*/
|
||||
public function getSha1() {
|
||||
$this->load();
|
||||
// Initialise now if necessary
|
||||
if ( $this->sha1 == '' && $this->fileExists ) {
|
||||
$this->lock();
|
||||
|
||||
$this->sha1 = $this->repo->getFileSha1( $this->getPath() );
|
||||
if ( !wfReadOnly() && strval( $this->sha1 ) != '' ) {
|
||||
$dbw = $this->repo->getPrimaryDB();
|
||||
$dbw->update( 'image',
|
||||
[ 'img_sha1' => $this->sha1 ],
|
||||
[ 'img_name' => $this->getName() ],
|
||||
__METHOD__ );
|
||||
$this->invalidateCache();
|
||||
}
|
||||
|
||||
$this->unlock();
|
||||
}
|
||||
|
||||
return $this->sha1;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue