Browse Source

Fix wait_temporary_metadata checking for incorrect filenames

tags/v1.1
JustAnotherArchivist 1 year ago
parent
commit
ee581f5c5c
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      codearchiver/storage.py

+ 2
- 2
codearchiver/storage.py View File

@@ -218,11 +218,11 @@ class DirectoryStorage(Storage):

def wait_temporary_metadata(self, names, sleepTime = 5):
_logger.info(f'Waiting for temporary metadata: {names!r}')
remaining = set(names)
remaining = {os.path.join(self._directory, f'{name}_codearchiver_temporary_metadata.txt') for name in names}
while remaining:
with self.lock(blocking = False) as locked:
if locked:
remaining = set(filename for filename in remaining if os.path.exists(os.path.join(self._directory, filename)))
remaining = {filename for filename in remaining if os.path.exists(filename)}
if not remaining:
break
time.sleep(sleepTime)


Loading…
Cancel
Save