Mercurial > piecrust2
comparison piecrust/baking/worker.py @ 876:d1095774bfcf
refactor: Fix some issues with record/cache entry collisions, add counters.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Thu, 15 Jun 2017 07:33:40 -0700 |
parents | 504ddb370df8 |
children | bf65a1a6992a |
comparison
equal
deleted
inserted
replaced
875:7169bf42ec60 | 876:d1095774bfcf |
---|---|
78 logger.debug("Received job: %s@%s" % (job.source_name, item.spec)) | 78 logger.debug("Received job: %s@%s" % (job.source_name, item.spec)) |
79 | 79 |
80 ppinfo = self.ppmngr.getPipeline(job.source_name) | 80 ppinfo = self.ppmngr.getPipeline(job.source_name) |
81 pp = ppinfo.pipeline | 81 pp = ppinfo.pipeline |
82 | 82 |
83 runctx = PipelineJobRunContext(job, pp.record_name, | |
84 self.record_histories) | |
85 | |
83 ppres = PipelineJobResult() | 86 ppres = PipelineJobResult() |
84 # For subsequent pass jobs, there will be a record entry given. For | 87 # For subsequent pass jobs, there will be a record entry given. For |
85 # first pass jobs, there's none so we get the pipeline to create it. | 88 # first pass jobs, there's none so we get the pipeline to create it. |
86 ppres.record_entry = job.data.get('record_entry') | 89 ppres.record_entry = job.data.get('record_entry') |
87 if ppres.record_entry is None: | 90 if ppres.record_entry is None: |
88 ppres.record_entry = pp.createRecordEntry(job) | 91 ppres.record_entry = pp.createRecordEntry(job, runctx) |
89 | |
90 runctx = PipelineJobRunContext(job, pp, self.record_histories) | |
91 pp.run(job, runctx, ppres) | 92 pp.run(job, runctx, ppres) |
92 return ppres | 93 return ppres |
93 | 94 |
94 def getStats(self): | 95 def getStats(self): |
95 stats = self.app.env.stats | 96 stats = self.app.env.stats |