Fix old tasks are kept in main queue and added debug output for tasks count that will be pushed back to main tasks queue.
This commit is contained in:
		| @@ -140,6 +140,7 @@ func startReally() { | |||||||
| 		// queue, clear it and re-add if queue items still be there. | 		// queue, clear it and re-add if queue items still be there. | ||||||
| 		tasksQueue := make([]*Task, 0, tasksCount) | 		tasksQueue := make([]*Task, 0, tasksCount) | ||||||
| 		tasksQueue = append(tasksQueue, tasks...) | 		tasksQueue = append(tasksQueue, tasks...) | ||||||
|  | 		tasks = make([]*Task, 0, 64) | ||||||
| 		tasksMutex.Unlock() | 		tasksMutex.Unlock() | ||||||
|  |  | ||||||
| 		// Get tasks list to launch. | 		// Get tasks list to launch. | ||||||
| @@ -151,6 +152,7 @@ func startReally() { | |||||||
| 		} | 		} | ||||||
| 		// Remove tasks that will be launched now. | 		// Remove tasks that will be launched now. | ||||||
| 		tasksQueue = tasksQueue[tasksToRunCount:] | 		tasksQueue = tasksQueue[tasksToRunCount:] | ||||||
|  | 		log.Println("Tasks count that will be returned to main queue:", len(tasksQueue)) | ||||||
| 		// Re-add remaining tasks to queue. | 		// Re-add remaining tasks to queue. | ||||||
| 		// Note: if another task was added to queue while we compose | 		// Note: if another task was added to queue while we compose | ||||||
| 		// our tasks list to launch - it will be executed BEFORE remaining | 		// our tasks list to launch - it will be executed BEFORE remaining | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user