mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-12-04 05:39:57 -05:00
Calculating time-to-import for map pbf files in the backend. These times were created using a test RPi4. Encoding URL of archive files to prevent error which blocked displaying of archives.
This commit is contained in:
parent
6a22090e54
commit
c815aa68c6
10 changed files with 46 additions and 59 deletions
|
|
@ -113,12 +113,14 @@ async def import_pbf(pbf: Path):
|
|||
|
||||
stdout, stderr = await proc.communicate()
|
||||
elapsed = now() - start
|
||||
logger.info(f'Import of {pbf} took {timedelta_to_timestamp(elapsed)}')
|
||||
success = 'Successful' if proc.returncode == 0 else 'Unsuccessful'
|
||||
logger.info(f'{success} import of {pbf.name} took {timedelta_to_timestamp(elapsed)}')
|
||||
if proc.returncode != 0:
|
||||
# Log all lines. Truncate long lines.
|
||||
for line in stdout.decode().splitlines():
|
||||
logger.info(line)
|
||||
logger.debug(line[:500])
|
||||
for line in stderr.decode().splitlines():
|
||||
logger.error(line)
|
||||
logger.error(line[:500])
|
||||
raise ValueError(f'Importing PBF failed with return code {proc.returncode}')
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue