Skip to content

Commit

Permalink
add some logger.debugs to IngestJobConsumer
Browse files Browse the repository at this point in the history
  • Loading branch information
aaxelb committed Jan 12, 2021
1 parent 79e8a2e commit 4e0c3ba
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions share/tasks/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,19 +298,26 @@ def _consume_job(self, job, superfluous, force, apply_changes=True, index=True,
datum = None
graph = None

logger.debug(f'>>> ingestjob({job.id}) -- starting')

# Check whether we've already done transform/regulate
if not superfluous:
logger.debug(f'>>> ingestjob({job.id}) -- looking for existing normd')
datum = job.ingested_normalized_data.order_by('-created_at').first()

if superfluous or datum is None:
logger.debug(f'>>> ingestjob({job.id}) -- fetching most recent raw')
most_recent_raw = job.suid.most_recent_raw_datum()

logger.debug(f'>>> ingestjob({job.id}) -- transforming')
graph = self._transform(job, most_recent_raw)
if not graph:
return
logger.debug(f'>>> ingestjob({job.id}) -- regulating')
graph = self._regulate(job, graph)
if not graph:
return
logger.debug(f'>>> ingestjob({job.id}) -- saving normd')
datum = NormalizedData.objects.create(
data=graph.to_jsonld(),
source=job.suid.source_config.source.user,
Expand All @@ -320,12 +327,15 @@ def _consume_job(self, job, superfluous, force, apply_changes=True, index=True,

# new Suid-based process
if pls_format_metadata:
logger.debug(f'>>> ingestjob({job.id}) -- formatting')
self._save_formatted_metadata(job.suid, datum, metadata_formats)
if index:
logger.debug(f'>>> ingestjob({job.id}) -- queueing for indexing')
self._queue_for_indexing(job.suid, urgent)

# soon-to-be-rended ShareObject-based process:
if apply_changes:
logger.debug(f'>>> ingestjob({job.id}) -- doing bad things')
if graph is None:
graph = MutableGraph.from_jsonld(datum.data)
updated_work_ids = self._apply_changes(job, graph, datum)
Expand Down

0 comments on commit 4e0c3ba

Please sign in to comment.