MCPcopy Create free account
hub / github.com/acl-dev/acl / proc_on_init

Method proc_on_init

lib_acl_cpp/samples/check_trigger/master_service.cpp:77–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75}
76
77void master_service::proc_on_init()
78{
79 // ȡ����Ҫ̽��� URL �б�
80 acl::string buf(var_cfg_http_url_list);
81 const std::list<acl::string>& tokens = buf.split(",; \t");
82 std::list<acl::string>::const_iterator cit = tokens.begin();
83 for (; cit != tokens.end(); ++cit)
84 {
85 url_list_.push_back(*cit);
86 logger("add url: %s", (*cit).c_str());
87 }
88
89 // �������ݿ����ӳ�
90 var_dbpool = new acl::sqlite_pool(var_cfg_dbpath,
91 var_cfg_http_cocurrent * url_list_.size());
92
93 // ����������ݿ�
94 db_store store;
95 if (store.db_create() == false)
96 logger_fatal("create db failed!");
97
98 // �����̳߳ز����ò���
99 var_thrpool = new acl::thread_pool;
100 var_thrpool->set_limit(var_cfg_http_cocurrent);
101 var_thrpool->set_idle(300);
102
103 // �����̳߳ع���
104 var_thrpool->start();
105}
106
107void master_service::proc_on_exit()
108{

Callers

nothing calls this directly

Calls 7

beginMethod · 0.80
endMethod · 0.45
push_backMethod · 0.45
c_strMethod · 0.45
sizeMethod · 0.45
db_createMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected