Skip to content
Snippets Groups Projects
Commit c8549bfd authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

jqueue: Log more information when running opcodes

Reviewed-by: iustinp
parent ff5fac04
No related branches found
No related tags found
No related merge requests found
...@@ -103,10 +103,12 @@ class _QueuedJob(object): ...@@ -103,10 +103,12 @@ class _QueuedJob(object):
""" """
try: try:
for op in self._ops: count = len(self._ops)
for idx, op in enumerate(self._ops):
try: try:
self._lock.acquire() self._lock.acquire()
try: try:
logging.debug("Op %s/%s: Starting %s", idx + 1, count, op)
op.status = constants.OP_STATUS_RUNNING op.status = constants.OP_STATUS_RUNNING
finally: finally:
self._lock.release() self._lock.release()
...@@ -115,6 +117,8 @@ class _QueuedJob(object): ...@@ -115,6 +117,8 @@ class _QueuedJob(object):
self._lock.acquire() self._lock.acquire()
try: try:
logging.debug("Op %s/%s: Successfully finished %s",
idx + 1, count, op)
op.status = constants.OP_STATUS_SUCCESS op.status = constants.OP_STATUS_SUCCESS
op.result = result op.result = result
finally: finally:
...@@ -122,6 +126,7 @@ class _QueuedJob(object): ...@@ -122,6 +126,7 @@ class _QueuedJob(object):
except Exception, err: except Exception, err:
self._lock.acquire() self._lock.acquire()
try: try:
logging.debug("Op %s/%s: Error in %s", idx + 1, count, op)
op.status = constants.OP_STATUS_ERROR op.status = constants.OP_STATUS_ERROR
op.result = str(err) op.result = str(err)
finally: finally:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment