크롤러 수행시 list 삭제
크롤러 log 분산 git-svn-id: svn://192.168.0.12/source@92 8346c931-da38-4b9b-9d4c-e48b93cbd075
This commit is contained in:
@@ -6,6 +6,7 @@ int main(int argc, char *argv[])
|
||||
QApplication a(argc, argv);
|
||||
Widget w;
|
||||
|
||||
|
||||
w.show();
|
||||
|
||||
return a.exec();
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "snavercafemanage.h"
|
||||
#include "snaverblogmanage.h"
|
||||
#include "sdaumcafemanage.h"
|
||||
#include <QApplication>
|
||||
|
||||
Widget::Widget(QWidget *parent) : QWidget(parent) , m_nMode(E_MODE_WAIT)
|
||||
{
|
||||
@@ -43,6 +44,7 @@ Widget::Widget(QWidget *parent) : QWidget(parent) , m_nMode(E_MODE_WAIT)
|
||||
|
||||
for (int i = 0 ; i < C_CRAWLER_MAX ; i++)
|
||||
m_pManage[i]->SetParent(this);
|
||||
setWindowTitle("CrawlerList " + QString::number(QCoreApplication::applicationPid()));
|
||||
|
||||
RefreshButton();
|
||||
m_timer.start(1000);
|
||||
@@ -113,7 +115,29 @@ void Widget::InsertLog(QString str)
|
||||
m_pResultList->addItem(strOut);
|
||||
QDate date = QDate::currentDate();
|
||||
|
||||
QFile file(date.toString(Qt::ISODate)+".log");
|
||||
/*
|
||||
QString _str;
|
||||
|
||||
|
||||
if(!m_pgbManual->isChecked())
|
||||
{
|
||||
_str = "RealTime";
|
||||
}
|
||||
else
|
||||
{
|
||||
_str = m_pcb->currentText();
|
||||
//qDebug() << _str;
|
||||
|
||||
_str = _str.replace("|","_");
|
||||
_str = _str.replace(" ","");
|
||||
_str = _str.replace(",","_");
|
||||
_str = _str.replace("~","_");
|
||||
_str = _str.replace("->","_");
|
||||
|
||||
//qDebug() << _str;
|
||||
}
|
||||
*/
|
||||
QFile file(date.toString(Qt::ISODate)+ "_" + QString::number(QCoreApplication::applicationPid())+ ".log");
|
||||
if (!file.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Append))
|
||||
return;
|
||||
|
||||
@@ -145,8 +169,10 @@ void Widget::SetCrawlingState(QString _str)
|
||||
}
|
||||
if (_str == QString("Start"))
|
||||
{
|
||||
if (m_pgbManual->isChecked() == false)
|
||||
//if (m_pgbManual->isChecked() == false)
|
||||
query.exec("UPDATE crawling set state = 1 where id = '" + m_strCrawlingID + "'");
|
||||
|
||||
|
||||
m_pgbManual->setEnabled(false);
|
||||
}
|
||||
}
|
||||
@@ -288,7 +314,7 @@ void Widget::Update()
|
||||
void Widget::RefreshButton()
|
||||
{
|
||||
m_pcb->clear();
|
||||
QSqlQuery query("SELECT keyword.searches,keyword.authorship,keyword.start,keyword.end,datagroup.name,keyword.platform,crawling.id "
|
||||
QSqlQuery query("SELECT keyword.searches,keyword.authorship,keyword.start,keyword.end,datagroup.name,keyword.platform,crawling.state,crawling.id "
|
||||
"FROM crawling INNER JOIN keyword ON crawling.keyword_id = keyword.id "
|
||||
"inner join datagroup on crawling.datagroup_id = datagroup.id where crawling.state = 0 and keyword.realtime = 0 ");
|
||||
while (query.next())
|
||||
@@ -305,6 +331,7 @@ void Widget::RefreshButton()
|
||||
case 1:str += ", Naver Blog";break;
|
||||
case 2:str += ", Daum Cafe"; break;
|
||||
}
|
||||
m_pcb->addItem(str,query.value(6));
|
||||
|
||||
m_pcb->addItem(str,query.value(7));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user