Automattic\WooCommerce\Internal\ProductFeed\Storage
JsonFileFeed::flush
{@inheritDoc}
Method of the class: JsonFileFeed{}
No Hooks.
Returns
null. Nothing (null).
Usage
$JsonFileFeed = new JsonFileFeed(); $JsonFileFeed->flush(): void;
JsonFileFeed::flush() JsonFileFeed::flush code WC 11.1.2
public function flush(): void {
if ( is_resource( $this->file_handle ) ) {
// Rely on fclose() to release the lock: it flushes the userspace buffer first and only then
// unlocks, so the lock stays held until the buffered bytes are durable. An explicit LOCK_UN
// here would release it while pending bytes are still buffered (see end()).
fclose( $this->file_handle );
$this->file_handle = null;
}
}