Revision c8549bfd lib/jqueue.py
b/lib/jqueue.py | ||
---|---|---|
103 | 103 |
|
104 | 104 |
""" |
105 | 105 |
try: |
106 |
for op in self._ops: |
|
106 |
count = len(self._ops) |
|
107 |
for idx, op in enumerate(self._ops): |
|
107 | 108 |
try: |
108 | 109 |
self._lock.acquire() |
109 | 110 |
try: |
111 |
logging.debug("Op %s/%s: Starting %s", idx + 1, count, op) |
|
110 | 112 |
op.status = constants.OP_STATUS_RUNNING |
111 | 113 |
finally: |
112 | 114 |
self._lock.release() |
... | ... | |
115 | 117 |
|
116 | 118 |
self._lock.acquire() |
117 | 119 |
try: |
120 |
logging.debug("Op %s/%s: Successfully finished %s", |
|
121 |
idx + 1, count, op) |
|
118 | 122 |
op.status = constants.OP_STATUS_SUCCESS |
119 | 123 |
op.result = result |
120 | 124 |
finally: |
... | ... | |
122 | 126 |
except Exception, err: |
123 | 127 |
self._lock.acquire() |
124 | 128 |
try: |
129 |
logging.debug("Op %s/%s: Error in %s", idx + 1, count, op) |
|
125 | 130 |
op.status = constants.OP_STATUS_ERROR |
126 | 131 |
op.result = str(err) |
127 | 132 |
finally: |
Also available in: Unified diff