Revision 03b63608 lib/jqueue.py
b/lib/jqueue.py | ||
---|---|---|
176 | 176 |
|
177 | 177 |
""" |
178 | 178 |
# pylint: disable-msg=W0212 |
179 |
__slots__ = ["queue", "id", "ops", "log_serial", "current_op",
|
|
179 |
__slots__ = ["queue", "id", "ops", "log_serial", "ops_iter",
|
|
180 | 180 |
"received_timestamp", "start_timestamp", "end_timestamp", |
181 | 181 |
"__weakref__"] |
182 | 182 |
|
... | ... | |
210 | 210 |
"""Initializes in-memory variables. |
211 | 211 |
|
212 | 212 |
""" |
213 |
obj.current_op = None
|
|
213 |
obj.ops_iter = None
|
|
214 | 214 |
|
215 | 215 |
def __repr__(self): |
216 | 216 |
status = ["%s.%s" % (self.__class__.__module__, self.__class__.__name__), |
... | ... | |
766 | 766 |
# lookups |
767 | 767 |
# TODO: Consider splitting _QueuedJob.ops into two separate lists, one for |
768 | 768 |
# pending and one for processed ops. |
769 |
if job.current_op is None:
|
|
770 |
job.current_op = enumerate(job.ops)
|
|
769 |
if job.ops_iter is None:
|
|
770 |
job.ops_iter = enumerate(job.ops)
|
|
771 | 771 |
|
772 | 772 |
# Find next opcode to run |
773 | 773 |
while True: |
774 | 774 |
try: |
775 |
(idx, op) = job.current_op.next()
|
|
775 |
(idx, op) = job.ops_iter.next()
|
|
776 | 776 |
except StopIteration: |
777 | 777 |
raise errors.ProgrammerError("Called for a finished job") |
778 | 778 |
|
Also available in: Unified diff