Skip to content

Commit 73d45de

Browse files
Merge pull request #30 from CppComet/alfa
fix restart problem
2 parents 96b7284 + 0efcb09 commit 73d45de

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

comet.ini

+4
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ interval = 3600
6969
[content-type]
7070
js = application/javascript
7171

72+
[sip]
73+
pipesalt = fFg34F3nf4n3fGF
74+
75+
7276
[log]
7377
level = 500; Logging level (600 output all, 200 errors only)
7478

src/MySql_connection.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -2359,6 +2359,7 @@ int MySql_connection::sql_insert_into_conference(thread_data* local_buf, unsigne
23592359
"message", // сообщение
23602360
"mode" // Режим video_*, audio_*
23612361
};
2362+
// Поле tabUUID передается или отслеживается через текст сообщения `message`
23622363

23632364
if(!local_buf->sql.prepare_columns_for_insert(columDef, local_buf->qInfo))
23642365
{

src/main.cpp

+11-1
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,11 @@ void command_line_fork()
276276

277277
if( strncmp(buf,"exit", strlen("exit") ) == 0 )
278278
{
279+
if(tcpServer <MySql_connection>::instance()->bm.get_uptime() < 60)
280+
{
281+
printf("\x1b[31mExit command ignore\x1b[0m\n");
282+
continue;
283+
}
279284
printf("\x1b[31mExit command received\x1b[0m\n");
280285
//kill(getppid(), SIGTERM);
281286
close(fd);
@@ -285,7 +290,12 @@ void command_line_fork()
285290
}
286291
else if( strncmp(buf,"restart", strlen("restart") ) == 0 )
287292
{
288-
printf("\x1b[31mExit command received\x1b[0m\n");
293+
if(tcpServer <MySql_connection>::instance()->bm.get_uptime() < 60)
294+
{
295+
printf("\x1b[31mRestart command ignore\x1b[0m\n");
296+
continue;
297+
}
298+
printf("\x1b[31mRestart command received\x1b[0m\n");
289299
//kill(pid, SIGTERM);
290300
close(fd);
291301
remove(NAMEDPIPE_NAME);

0 commit comments

Comments
 (0)