git:master:d4edeb82: acc: check if async task workers are active before doing async insert

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

git:master:d4edeb82: acc: check if async task workers are active before doing async insert

Daniel-Constantin Mierla-6
Module: kamailio
Branch: master
Commit: d4edeb823290e47cafa7952d4a029d7cfae9723a
URL: https://github.com/kamailio/kamailio/commit/d4edeb823290e47cafa7952d4a029d7cfae9723a

Author: Daniel-Constantin Mierla <[hidden email]>
Committer: Daniel-Constantin Mierla <[hidden email]>
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/d4edeb823290e47cafa7952d4a029d7cfae9723a.diff
Patch: https://github.com/kamailio/kamailio/commit/d4edeb823290e47cafa7952d4a029d7cfae9723a.patch

---

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;


_______________________________________________
Kamailio (SER) - Development Mailing List
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev