| | |
| | | #include "mbtaskmgr.h" |
| | | #include "mbtasklog.h" |
| | | |
| | | CMBTaskMgr::CMBTaskMgr() |
| | | { |
| | | m_pMdWare = NULL; |
| | | //线程池最多1个线程 |
| | | m_threadPool.setMaxThreadCount(1); |
| | | m_threadPool.setMaxThreadCount(3); |
| | | } |
| | | |
| | | CMBTaskMgr::~CMBTaskMgr() |
| | |
| | | |
| | | } |
| | | |
| | | void CMBTaskMgr::setMdWare(CMBMdware *pMdWare) |
| | | { |
| | | m_pMdWare = pMdWare; |
| | | } |
| | | |
| | | void CMBTaskMgr::stopThread() |
| | | { |
| | | m_threadPool.waitForDone(100); // 100毫秒 |
| | | } |
| | | |
| | | void CMBTaskMgr::logTask(QString login, QString svrID, QString backupDir, QString svrPath) |
| | | void CMBTaskMgr::logTask(QString logDbPath, QString backupDir, QString svrPath) |
| | | { |
| | | CMBTaskLog *pTask = new CMBTaskLog(); |
| | | |
| | | pTask->setMdWare(m_pMdWare); |
| | | pTask->set(logDbPath, backupDir, svrPath); |
| | | pTask->setAutoDelete(true); |
| | | m_threadPool.start(pTask); |
| | | } |
| | | |
| | | |