예제 #1
0
        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;
            }
        }
예제 #2
0
파일: Backup.cs 프로젝트: NiKiZe/BlobBackup
        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);
            }
        }