Skip to content

Commit

Permalink
Merge pull request #30 from CppComet/alfa
Browse files Browse the repository at this point in the history
 fix restart problem
  • Loading branch information
VictorTrapenok authored Nov 2, 2017
2 parents 96b7284 + 0efcb09 commit 73d45de
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
4 changes: 4 additions & 0 deletions comet.ini
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ interval = 3600
[content-type]
js = application/javascript

[sip]
pipesalt = fFg34F3nf4n3fGF


[log]
level = 500; Logging level (600 output all, 200 errors only)

Expand Down
1 change: 1 addition & 0 deletions src/MySql_connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2359,6 +2359,7 @@ int MySql_connection::sql_insert_into_conference(thread_data* local_buf, unsigne
"message", // сообщение
"mode" // Режим video_*, audio_*
};
// Поле tabUUID передается или отслеживается через текст сообщения `message`

if(!local_buf->sql.prepare_columns_for_insert(columDef, local_buf->qInfo))
{
Expand Down
12 changes: 11 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,11 @@ void command_line_fork()

if( strncmp(buf,"exit", strlen("exit") ) == 0 )
{
if(tcpServer <MySql_connection>::instance()->bm.get_uptime() < 60)
{
printf("\x1b[31mExit command ignore\x1b[0m\n");
continue;
}
printf("\x1b[31mExit command received\x1b[0m\n");
//kill(getppid(), SIGTERM);
close(fd);
Expand All @@ -285,7 +290,12 @@ void command_line_fork()
}
else if( strncmp(buf,"restart", strlen("restart") ) == 0 )
{
printf("\x1b[31mExit command received\x1b[0m\n");
if(tcpServer <MySql_connection>::instance()->bm.get_uptime() < 60)
{
printf("\x1b[31mRestart command ignore\x1b[0m\n");
continue;
}
printf("\x1b[31mRestart command received\x1b[0m\n");
//kill(pid, SIGTERM);
close(fd);
remove(NAMEDPIPE_NAME);
Expand Down

0 comments on commit 73d45de

Please sign in to comment.