private bool disposedValue = false; // To detect redundant calls protected virtual void Dispose(bool disposing) { if (!disposedValue) { if (disposing) { var sqlInstance = _sqlLite; if (sqlInstance != null) { sqlInstance.Dispose(); _sqlLite = null; } var runQ = BlobJobQueue; if (runQ != null) { runQ.Dispose(); BlobJobQueue = null; } } ExpectedLocalFiles = null; disposedValue = true; } }
internal async Task WaitTaskAndClean() { var taskSet = GetTasks(); if (taskSet.Length == 0) { return; } var finishedTask = await Task.WhenAny(taskSet); lock (_tasksListLock) { _tasks.Remove(finishedTask); RunQueue <BlobJob> .CleanupTaskList(_tasks); } }