Skip to content

Commit

Permalink
add log messages to see when sync_bucket starts and ends processing s…
Browse files Browse the repository at this point in the history
…ince it may potentially run a long time
  • Loading branch information
infinitewarp committed Nov 7, 2019
1 parent 9f71300 commit 4f4caa7
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions koku/api/dataexport/syncer/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Data export syncer."""
import uuid
from abc import ABC, abstractmethod
from datetime import timedelta
from itertools import product
Expand Down Expand Up @@ -107,6 +108,15 @@ def sync_bucket(self, schema_name, s3_destination_bucket_name, date_range):
"""
if settings.ENABLE_S3_ARCHIVING:
log_uuid = str(uuid.uuid4())
LOG.info(
'%s Beginning sync_bucket to %s for %s from %s to %s',
log_uuid,
s3_destination_bucket_name,
schema_name,
date_range[0],
date_range[1],
)
start_date, end_date = date_range
# rrule is inclusive for both dates, so we need to make end_date exclusive
end_date = end_date - timedelta(days=1)
Expand Down Expand Up @@ -144,3 +154,12 @@ def sync_bucket(self, schema_name, s3_destination_bucket_name, date_range):
Prefix=prefix
):
self._copy_object(s3_destination_bucket, source_object)

LOG.info(
'%s Completed sync_bucket to %s for %s from %s to %s',
log_uuid,
s3_destination_bucket_name,
schema_name,
date_range[0],
date_range[1],
)

0 comments on commit 4f4caa7

Please sign in to comment.