kget
scheduler.cpp
Go to the documentation of this file.
218 // Second condition: if count > reconnectRetries and Timeout happened trigger a stop/start BUT only if
219 // 10 timeouts have happened (9 of them without taking any action). This means every 10*Settings::reconnectDelay() (ex. 15s -> 150s)
220 (failure.count > Settings::reconnectRetries() && (failure.status == StallTimeout || failure.status == AbortTimeout)
224 //static_cast<Transfer*>(job)->handler()->stop();// This will trigger the changedEvent which will trigger an updateQueue call
226 } else if (failure.count <= Settings::reconnectRetries() && (failure.status == StallTimeout || failure.status == AbortTimeout)){
236 std::for_each(m_queues.begin(), m_queues.end(), boost::bind(&JobQueue::setStatus, _1, JobQueue::Running));
241 std::for_each(m_queues.begin(), m_queues.end(), boost::bind(&JobQueue::setStatus, _1, JobQueue::Stopped));
254 int waitingJobs = 0; //Jobs that we leave running but are in stallTimeout. We wait for them to start downloading, while we start other ones
284 if( runningJobs < queue->maxSimultaneousJobs() && ((runningJobs + waitingJobs) < 2 * queue->maxSimultaneousJobs()) )
304 if((failure.status == None || failure.status == AboutToStall) && (*it)->status() != Job::FinishedKeepAlive)
432 // kDebug(5001) << "failure = " << failure.status << " T=" << failure.time << " prevFailure = " << prevFailure.status;
Definition: scheduler.h:41
void setIsSuspended(bool isSuspended)
Can be used to suspend the scheduler before doing lenghty operations and activating it later again...
Definition: scheduler.cpp:39
The job is stopped, but this also indicates that it stopped because an error occurred.
Definition: job.h:47
virtual void jobQueueRemovedJobsEvent(JobQueue *queue, const QList< Job * > jobs)
Definition: scheduler.cpp:163
Definition: job.h:69
The scheduler should start this job even if its queue isn't in a Running status.
Definition: job.h:60
Definition: scheduler.h:44
Definition: scheduler.h:50
virtual void jobQueueChangedEvent(JobQueue *queue, JobQueue::Status status)
Definition: scheduler.cpp:117
Definition: scheduler.h:45
Definition: jobqueue.h:36
virtual void jobQueueAddedJobsEvent(JobQueue *queue, const QList< Job * > jobs)
Definition: scheduler.cpp:148
Definition: scheduler.h:43
Definition: scheduler.h:46
void updateQueue(JobQueue *queue)
Updates the given queue, starting the jobs that come first in the queue and stopping all the other...
Definition: scheduler.cpp:244
void append(const T &value)
Definition: job.h:43
virtual void jobQueueMovedJobEvent(JobQueue *queue, Job *job)
Definition: scheduler.cpp:134
virtual void stop()=0
Definition: scheduler.h:42
int removeAll(const T &value)
virtual void jobChangedEvent(Job *job, Job::Status status)
Definition: scheduler.cpp:170
void setHasNetworkConnection(bool hasConnection)
The JobQueues will be informed of changes in the network connection If there is no network connection...
Definition: scheduler.cpp:50
Definition: settings.h:10
iterator end()
bool contains(const T &value) const
Definition: jobqueue.h:36
int startTimer(int interval)
void settingsChanged()
This function gets called by the KGet class whenever the settings have changed.
Definition: scheduler.cpp:109
Definition: jobqueue.h:32
virtual void jobQueueAddedJobEvent(JobQueue *queue, Job *job)
Definition: scheduler.cpp:141
virtual void jobQueueRemovedJobEvent(JobQueue *queue, Job *job)
Definition: scheduler.cpp:156
Definition: scheduler.h:47
void killTimer(int id)
iterator begin()
Definition: job.h:58
Definition: transfer.h:36
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:28:43 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:28:43 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.