Skip to content

Commit

Permalink
Logging bulk importer job
Browse files Browse the repository at this point in the history
  • Loading branch information
snyaggarwal committed Dec 14, 2020
1 parent 54c2b6c commit 311260e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/importers/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import time
from datetime import datetime

from celery.utils.log import get_task_logger
from django.db.models import F
from ocldev.oclfleximporter import OclFlexImporter
from pydash import compact
Expand All @@ -16,6 +17,8 @@
from core.sources.models import Source
from core.users.models import UserProfile

logger = get_task_logger(__name__)


class ImportResults:
def __init__(self, importer):
Expand Down Expand Up @@ -468,6 +471,7 @@ def notify_progress(self):
def run(self):
for original_item in self.input_list:
self.processed += 1
logger.info('Processing {} of {} | Started at {}'.format(self.processed, self.total, self.start_time))
self.notify_progress()
item = original_item.copy()
item_type = item.pop('type', '').lower()
Expand Down

0 comments on commit 311260e

Please sign in to comment.