Skip to content

Commit dbf3c3e

Browse files
committed
always download sheet
Signed-off-by: John Seekins <[email protected]>
1 parent 42ec02a commit dbf3c3e

File tree

1 file changed

+6
-15
lines changed

1 file changed

+6
-15
lines changed

scraper.py

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -53,21 +53,12 @@ def _download_sheet(self) -> None:
5353

5454
logger.debug("Found sheet at: %s", actual_link)
5555
self.sheet_url = actual_link
56-
now = time.time()
57-
# one day in seconds is 86400
58-
if (
59-
not os.path.isfile(self.filename)
60-
or os.path.getsize(self.filename) < 1
61-
or now - os.path.getmtime(self.filename) > 86400
62-
):
63-
logger.info("Downloading detention stats sheet from %s", self.sheet_url)
64-
resp = session.get(self.sheet_url, timeout=120)
65-
with open(self.filename, "wb") as f:
66-
for chunk in resp.iter_content(chunk_size=1024):
67-
if chunk:
68-
f.write(chunk)
69-
else:
70-
logger.info("Using cached detention stats sheet: %s", self.filename)
56+
logger.info("Downloading detention stats sheet from %s", self.sheet_url)
57+
resp = session.get(self.sheet_url, timeout=120)
58+
with open(self.filename, "wb") as f:
59+
for chunk in resp.iter_content(chunk_size=1024):
60+
if chunk:
61+
f.write(chunk)
7162

7263
def _clean_street(self, street: str, locality: str = "") -> Tuple[str, bool]:
7364
"""Generally, we'll let the spreadsheet win arguments just to be consistent"""

0 commit comments

Comments
 (0)