We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
main.cpp
int main() { /* 守护进程 后台运行 */ //daemon(1, 0); WebServer server( 1316, 3, 60000, false, /* 端口 ET模式 timeoutMs 优雅退出 */ 3306, "root", "root", "webserver", /* Mysql配置 */ 12, 6, true, 1, 1024); /* 连接池数量 线程池数量 日志开关 日志等级 日志异步队列容量 */ server.Start(); }
webserver,cpp
Log::Instance()->init(logLevel, "./log", ".log", logQueSize);
log.cpp
void Log::init(int level = 1, const char* path, const char* suffix, int maxQueueSize) { isOpen_ = true; level_ = level; if(maxQueueSize > 0) { isAsync_ = true; if(!deque_) { unique_ptr<BlockDeque<std::string>> newDeque(new BlockDeque<std::string>); deque_ = move(newDeque); std::unique_ptr<std::thread> NewThread(new thread(FlushLogThread)); writeThread_ = move(NewThread); } } else { isAsync_ = false; } }
blockqueue.h
explicit BlockDeque(size_t MaxCapacity = 1000); template<class T> BlockDeque<T>::BlockDeque(size_t MaxCapacity) :capacity_(MaxCapacity) { assert(MaxCapacity > 0); isClose_ = false; }
当设置了 logQueSize > 0,实际的异步日志队列容量并不是设置的logQueSize,而是默认的1000
unique_ptr<BlockDeque<std::string>> newDeque(new BlockDeque<std::string>);
应该修改为
unique_ptr<BlockDeque<std::string>> newDeque(new BlockDeque<std::string>(logQueSize));
The text was updated successfully, but these errors were encountered:
No branches or pull requests
main.cpp
webserver,cpp
log.cpp
blockqueue.h
当设置了 logQueSize > 0,实际的异步日志队列容量并不是设置的logQueSize,而是默认的1000
应该修改为
The text was updated successfully, but these errors were encountered: