Skip to content

Commit

Permalink
Download new pbf file if current one is corrupted
Browse files Browse the repository at this point in the history
  • Loading branch information
jocelynj committed May 2, 2021
1 parent 80ad353 commit 9898800
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions modules/OsmOsisManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,9 +384,13 @@ def check_osmium_diff(self, conf):
pbf_file = conf.download["dst"]
from osmium.replication.utils import get_replication_header # type: ignore

# check if osmosis_* headers for replication are present
url, seq, ts = get_replication_header(pbf_file)
if url is None or seq is None or ts is None:
try:
# check if osmosis_* headers for replication are present
url, seq, ts = get_replication_header(pbf_file)
if url is None or seq is None or ts is None:
return False
except:
# can happen if pbf file is corrupted
return False

return True
Expand Down

0 comments on commit 9898800

Please sign in to comment.