Module: kamailio
Branch: master
Commit: d4edeb823290e47cafa7952d4a029d7cfae9723a
URL:
https://github.com/kamailio/kamailio/commit/d4edeb823290e47cafa7952d4a029d7…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2017-11-12T12:08:02+01:00
acc: check if async task workers are active before doing async insert
---
Modified: src/modules/acc/acc.c
---
Diff:
https://github.com/kamailio/kamailio/commit/d4edeb823290e47cafa7952d4a029d7…
Patch:
https://github.com/kamailio/kamailio/commit/d4edeb823290e47cafa7952d4a029d7…
---
diff --git a/src/modules/acc/acc.c b/src/modules/acc/acc.c
index ad2df5a6c2..24d26304e5 100644
--- a/src/modules/acc/acc.c
+++ b/src/modules/acc/acc.c
@@ -35,6 +35,7 @@
#include "../../core/error.h"
#include "../../core/mem/mem.h"
#include "../../core/usr_avp.h"
+#include "../../core/async_task.h"
#include "../../lib/srdb1/db.h"
#include "../../core/parser/hf.h"
#include "../../core/parser/msg_parser.h"
@@ -465,7 +466,8 @@ int acc_db_request( struct sip_msg *rq)
LM_ERR("failed to insert delayed into database\n");
goto error;
}
- } else if(acc_db_insert_mode==2 && acc_dbf.insert_async!=NULL) {
+ } else if(acc_db_insert_mode==2 && acc_dbf.insert_async!=NULL
+ && async_task_workers_active()) {
if (acc_dbf.insert_async(db_handle, db_keys, db_vals, m) < 0) {
LM_ERR("failed to insert async into database\n");
goto error;