/* */ #include "AutoSaveCommand.h" #include "DownloadEngine.h" #include "RequestGroupMan.h" namespace aria2 { AutoSaveCommand::AutoSaveCommand(cuid_t cuid, DownloadEngine* e, std::chrono::seconds interval) : TimeBasedCommand(cuid, e, std::move(interval), true) { } AutoSaveCommand::~AutoSaveCommand() {} void AutoSaveCommand::preProcess() { if (getDownloadEngine()->getRequestGroupMan()->downloadFinished() || getDownloadEngine()->isHaltRequested()) { enableExit(); } } void AutoSaveCommand::process() { getDownloadEngine()->getRequestGroupMan()->save(); } } // namespace aria2