Remove unused doctest, only sleep if not last year to process
This commit is contained in:
1 parent
fc52bf17fa
commit
0b623e6bb3
1 file changed
+1
-1
@@ -4,7 +4,6 @@
|
||||
Functions for collecting data for insertion into the databse or pulling data from the database for analysis
|
||||
"""
|
||||
from datetime import datetime, timedelta
|
||||
from doctest import script_from_examples
|
||||
from time import sleep
|
||||
|
||||
from sqlalchemy import func
|
||||
@@ -78,6 +77,7 @@ def get_missing_records(table_name: str) -> int:
|
||||
insert_count += 1
|
||||
except IntegrityError:
|
||||
session.rollback()
|
||||
if year != end_year - 1:
|
||||
sleep(30) # sleep between calls to the site for data to avoid being blocked
|
||||
|
||||
return insert_count
|
||||
|
||||
Reference in new issue
Block a user