diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2013-01-10 00:12:53 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2013-01-10 00:15:30 +0900 |
| commit | 8e63bad2da930c80d8f049376e61bd7152038ced (patch) | |
| tree | 75ce1cfcf4da799709f01d6773d40182a2e1da9c /src/DownloadEngineFactory.cc | |
| parent | 794f7b7014bc7e28c3436a7923d66365f238ee12 (diff) | |
Added --save-session-interval option
--save-session-interval option saves error/unfinished downloads to a
file specified by --save-session option every SEC seconds. If 0 is
given, file will be saved only when aria2 exits.
Diffstat (limited to 'src/DownloadEngineFactory.cc')
| -rw-r--r-- | src/DownloadEngineFactory.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/DownloadEngineFactory.cc b/src/DownloadEngineFactory.cc index ee328c5e..ac7048bb 100644 --- a/src/DownloadEngineFactory.cc +++ b/src/DownloadEngineFactory.cc @@ -50,6 +50,7 @@ #include "FillRequestGroupCommand.h" #include "FileAllocationDispatcherCommand.h" #include "AutoSaveCommand.h" +#include "SaveSessionCommand.h" #include "HaveEraseCommand.h" #include "TimedHaltCommand.h" #include "WatchProcessCommand.h" @@ -158,6 +159,11 @@ DownloadEngineFactory::newDownloadEngine (new AutoSaveCommand(e->newCUID(), e.get(), op->getAsInt(PREF_AUTO_SAVE_INTERVAL))); } + if(op->getAsInt(PREF_SAVE_SESSION_INTERVAL) > 0) { + e->addRoutineCommand + (new SaveSessionCommand(e->newCUID(), e.get(), + op->getAsInt(PREF_SAVE_SESSION_INTERVAL))); + } e->addRoutineCommand(new HaveEraseCommand(e->newCUID(), e.get(), 10)); { time_t stopSec = op->getAsInt(PREF_STOP); |
