Skip to content

Commit

Permalink
Only calculate modified_since if relevant.
Browse files Browse the repository at this point in the history
  • Loading branch information
anjackson committed Sep 18, 2023
1 parent c357cd5 commit 7ca6082
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/windex/cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,6 @@ def main():
elif args.verbose > 1:
logging.getLogger().setLevel(logging.DEBUG)

# Work out the date we're looking back to
modified_since = datetime.now() - relativedelta(years=args.years_back)
logger.info(f"Looking for TrackDB entries since {modified_since}.")

# Set up full CDX endpoint URL:
if "cdx_service" in args:
cdx_url = urllib.parse.urljoin(args.cdx_service, args.cdx_collection)
Expand All @@ -192,6 +188,9 @@ def main():
elif args.op == 'cdx-index' or args.op == 'solr-index':
# Setup TrackDB
tdb = SolrTrackDB(args.trackdb_url, hadoop=args.service, kind='warcs')
# Work out the date we're looking back to:
modified_since = datetime.now() - relativedelta(years=args.years_back)
logger.info(f"Looking for TrackDB entries since {modified_since}.")
# Record task start time:
started_at = datetime.now()
# Setup an event record:
Expand Down

0 comments on commit 7ca6082

Please sign in to comment.