Procházet zdrojové kódy

Fix wait_temporary_metadata checking for incorrect filenames

tags/v1.1
JustAnotherArchivist před 1 rokem
rodič
revize
ee581f5c5c
1 změnil soubory, kde provedl 2 přidání a 2 odebrání
  1. +2
    -2
      codearchiver/storage.py

+ 2
- 2
codearchiver/storage.py Zobrazit soubor

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


def wait_temporary_metadata(self, names, sleepTime = 5): def wait_temporary_metadata(self, names, sleepTime = 5):
_logger.info(f'Waiting for temporary metadata: {names!r}') _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: while remaining:
with self.lock(blocking = False) as locked: with self.lock(blocking = False) as locked:
if 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: if not remaining:
break break
time.sleep(sleepTime) time.sleep(sleepTime)


Načítá se…
Zrušit
Uložit