Details
-
Improvement
-
Resolution: Obsolete
-
Medium
-
None
-
3.10.0, 3.9.4, 4.0.0
-
None
Description
function lock() does a ClearMeta and a SetMeta in a row. This involves creating 2 tmp files and 2 file renames, while one would be enough.
Patch:
- add a 3rd param to SetMeta: $clear=false
- if $clear !== false, do not unserialize $this->currentFileName
- lock calls setMeta( 'timestamp', time(), true )
function setMeta( $key, $value, $clear=false) { $tmpFile = $this->MetaFileName . substr( md5( mt_rand() ), 0, 8 ); if ( $clear !== false && file_exists( $this->MetaFileName ) ) { $content = unserialize( eZFile::getContents( $this->MetaFileName ) ); } else { $content = array(); } $content[$key] = $value; eZFile::create( $tmpFile, false, serialize( $content) ); eZFile::rename( $tmpFile, $this->MetaFileName ); }
Attachments
Issue Links
- relates to
-
EZP-13872 eZ Publish (cluster) scalability effort
- Closed