Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1ae68b9

Browse files
committed
Update for an Issue #405 (fix for usage of old 'complete' data from previous runs)
1 parent f6c7b39 commit 1ae68b9

1 file changed

Lines changed: 2 additions & 9 deletions

File tree

lib/utils/api.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,6 @@ def __init__(self, taskid, messagetype="stdout"):
187187

188188
def write(self, value, status=CONTENT_STATUS.IN_PROGRESS, content_type=None):
189189
if self.messagetype == "stdout":
190-
insert = True
191-
192190
if content_type is None:
193191
if kb.partRun is not None:
194192
content_type = PART_RUN_CONTENT_TYPES.get(kb.partRun)
@@ -205,14 +203,9 @@ def write(self, value, status=CONTENT_STATUS.IN_PROGRESS, content_type=None):
205203
if status == CONTENT_STATUS.COMPLETE:
206204
if len(output) > 0:
207205
for index in xrange(0, len(output)):
208-
if output[index][1] == CONTENT_STATUS.COMPLETE:
209-
insert = False
210-
else:
211-
conf.database_cursor.execute("DELETE FROM data WHERE id = ?", (output[index][0],))
206+
conf.database_cursor.execute("DELETE FROM data WHERE id = ?", (output[index][0],))
212207

213-
if insert:
214-
conf.database_cursor.execute("INSERT INTO data VALUES(NULL, ?, ?, ?, ?)",
215-
(self.taskid, status, content_type, jsonize(value)))
208+
conf.database_cursor.execute("INSERT INTO data VALUES(NULL, ?, ?, ?, ?)", (self.taskid, status, content_type, jsonize(value)))
216209
if kb.partRun:
217210
kb.partRun = None
218211

0 commit comments

Comments
 (0)