From 1839a7371783b7a0555e63b9da31f9970c82d4f3 Mon Sep 17 00:00:00 2001 From: "Stanislav N. aka pztrn" Date: Sat, 18 May 2019 19:10:18 +0500 Subject: [PATCH] Fix old tasks are kept in main queue and added debug output for tasks count that will be pushed back to main tasks queue. --- converter/exported.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/converter/exported.go b/converter/exported.go index e296069..9820abb 100644 --- a/converter/exported.go +++ b/converter/exported.go @@ -140,6 +140,7 @@ func startReally() { // queue, clear it and re-add if queue items still be there. tasksQueue := make([]*Task, 0, tasksCount) tasksQueue = append(tasksQueue, tasks...) + tasks = make([]*Task, 0, 64) tasksMutex.Unlock() // Get tasks list to launch. @@ -151,6 +152,7 @@ func startReally() { } // Remove tasks that will be launched now. tasksQueue = tasksQueue[tasksToRunCount:] + log.Println("Tasks count that will be returned to main queue:", len(tasksQueue)) // Re-add remaining tasks to queue. // Note: if another task was added to queue while we compose // our tasks list to launch - it will be executed BEFORE remaining