Skip to content

Commit

Permalink
Fix restart the process
Browse files Browse the repository at this point in the history
  • Loading branch information
hggq committed Jan 1, 2025
1 parent 5aba3d0 commit 3b291d6
Showing 1 changed file with 25 additions and 8 deletions.
33 changes: 25 additions & 8 deletions vendor/httpserver/src/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3814,6 +3814,9 @@ void httpserver::httpwatch()
unsigned int mysqlpool_time = 1;
unsigned int remove_linknum = 0;
unsigned int old_total_count= 0;

unsigned int old_ten_total_count = 0;

std::size_t n_write = 0;
unsigned char cron_type = 0x00;
unsigned char cron_day = 0x00;
Expand Down Expand Up @@ -4427,13 +4430,20 @@ void httpserver::httpwatch()
//may be asio post pool is die;
if(total_http2_count.load()>2)
{
std::unique_lock<std::mutex> loglock(log_mutex);
error_loglist.push_back("--total_http2_count > 2 --\n");
loglock.unlock();
error_msg_loop.clear();
error_msg_loop.append("-- total_http2_count ");
error_msg_loop.append(std::to_string(total_http1_count.load()));
error_msg_loop.append(" --\n");

if(plan_http2_exit==0)
{
old_ten_total_count = old_total_count;
}

plan_http2_exit ++;
if(plan_http2_exit>1)
{
if(old_total_count == total_count.load())
if(old_ten_total_count == total_count.load())
{
isstop = true;
}
Expand All @@ -4452,13 +4462,20 @@ void httpserver::httpwatch()
}
if(total_http1_count.load()>2)
{
std::unique_lock<std::mutex> loglock(log_mutex);
error_loglist.push_back("--total_http1_count > 2 --\n");
loglock.unlock();
error_msg_loop.clear();
error_msg_loop.append("-- total_http1_count ");
error_msg_loop.append(std::to_string(total_http1_count.load()));
error_msg_loop.append(" --\n");

if(plan_http1_exit==0)
{
old_ten_total_count = old_total_count;
}

plan_http1_exit ++;
if(plan_http1_exit >1)
{
if(old_total_count==total_count.load())
if(old_ten_total_count == total_count.load())
{
isstop = true;
}
Expand Down

0 comments on commit 3b291d6

Please sign in to comment.