Skip to content

Commit

Permalink
set directory for removal of block manifest file
Browse files Browse the repository at this point in the history
  • Loading branch information
petersilva committed Jun 12, 2024
1 parent 8e22567 commit d75ee14
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions sarracenia/flowcb/block_reassembly.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,11 @@ def after_work(self, worklist) -> None:
byteCount = m['blocks']['manifest'][blkno]['size']

logger.info( f" blocks: adding block {blkno} by seeking to: {offset} to write {byteCount} bytes in {root_file}" )
logger.info( f" still waiting for: {len(old_blocks['waiting'])} " )
if len(old_blocks['waiting']) > 0 :
logger.info( f" still waiting for: {len(old_blocks['waiting'])} " )
else:
logger.info( f" we have received every block now." )

#- {old_blocks['waiting']} " )

# FIXME: can seek ever fail? how do we check?
Expand Down Expand Up @@ -245,10 +249,13 @@ def after_work(self, worklist) -> None:
logger.info( f"completed reassembly of {m['relPath']}" )
new_ok.append(m)
if hasattr(self.o, 'block_manifest_delete') and self.o.block_manifest_delete:
manifest = m['new_file'] + "§block_manifest§"
manifest = m['new_dir'] + os.sep + m['new_file'] + "§block_manifest§"
logger.info( f"should delete manifest: {manifest}")
if os.path.exists(manifest):
logger.info( f"deleting {manifest}")
os.unlink(manifest)
else:
logger.info( "it did not exist!" )
else:
logger.info( f"persisting {root_file} manifest.")
del old_blocks['waiting']
Expand Down

0 comments on commit d75ee14

Please sign in to comment.