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

Method queue_manager

lib_acl_cpp/src/queue/queue_manager.cpp:18–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16{
17
18queue_manager::queue_manager(const char* home, const char* queueName,
19 unsigned sub_width)
20: m_scanDir(NULL)
21, m_home(home)
22, m_queueName(queueName)
23{
24 if (sub_width == 0) {
25 sub_width_ = 2;
26 } else {
27 sub_width_ = sub_width;
28 }
29
30 string buf(home);
31 buf << PATH_SEP << queueName;
32
33 // �ȴ�����Ŀ¼
34 if (acl_make_dirs(buf.c_str(), 0700) == -1) {
35 logger_error("create dir: %s error %s", buf.c_str(),
36 last_serror());
37 } else {
38 logger("create dir: %s ok", buf.c_str());
39 }
40
41 char node[32];
42 for (unsigned i = 0; i < sub_width_; i++) {
43 buf.clear();
44 safe_snprintf(node, sizeof(node), "%d", i);
45 buf << home << PATH_SEP << queueName
46 << PATH_SEP << node;
47 // ������������Ŀ¼
48 if (acl_make_dirs(buf.c_str(), 0700) == -1) {
49 logger_error("create dir: %s error %s",
50 buf.c_str(), last_serror());
51 } else {
52 logger("create dir: %s ok", buf.c_str());
53 }
54 }
55}
56
57queue_manager::~queue_manager(void)
58{

Callers

nothing calls this directly

Calls 5

acl_make_dirsFunction · 0.85
safe_snprintfFunction · 0.85
last_serrorFunction · 0.50
c_strMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected