• Steven Allen's avatar
    feat: put all temporary files in the same directory and clean them up on start · 5b09ebfb
    Steven Allen authored
    Otherwise, if we repeatedly stop the same node, we'll collect a bunch of
    temporary files and NEVER DELETE them. This will:
    
    1. Waste space.
    2. Slow down queries/GC.
    
    This patch:
    
    1. Moves all temporary files to a single `.temp` directory. The leading `.`
    means it can't conflict with any keys and queries (even on older flatfs
    versions) will skip it.
    2. Adds an "rm -rf flatfs-dir/.temp" call on start.
    5b09ebfb
flatfs.go 26.4 KB