MCPcopy Index your code
hub / github.com/saltstack/salt / _init_heap_file

Method _init_heap_file

salt/utils/mmap_cache.py:423–435  ·  view source on GitHub ↗

Create segment-0 heap file if it does not exist.

(self)

Source from the content-addressed store, hash-verified

421 return True
422
423 def _init_heap_file(self):
424 """Create segment-0 heap file if it does not exist."""
425 if os.path.exists(self.heap_path):
426 return True
427 try:
428 os.makedirs(os.path.dirname(self.heap_path), exist_ok=True)
429 with salt.utils.files.fopen(self.heap_path, "wb") as f:
430 f.flush()
431 os.fsync(f.fileno())
432 except OSError as exc:
433 log.error("Failed to initialize heap file: %s", exc)
434 return False
435 return True
436
437 def _discover_segments(self):
438 """

Callers 2

openMethod · 0.95

Calls 4

existsMethod · 0.45
flushMethod · 0.45
filenoMethod · 0.45
errorMethod · 0.45