Skip to content

Commit

Permalink
clean up after some debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
aaxelb committed Jan 13, 2021
1 parent e104a52 commit c36d25a
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions share/tasks/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,26 +298,19 @@ 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 @@ -340,7 +333,6 @@ def _consume_job(self, job, superfluous, force, apply_changes=True, index=True,

# 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 c36d25a

Please sign in to comment.