flush method
Flushes in-memory metadata and pin state to persistent storage.
Implementation
Future<void> flush() async {
_logger.debug('Flushing BlockStore state to disk...');
try {
final pinsFile = p.join(path, 'pins.json');
await _pinManager.save(pinsFile);
_logger.debug('BlockStore flush completed successfully');
} catch (e, stackTrace) {
_logger.error('Failed to flush BlockStore state', e, stackTrace);
rethrow;
}
}