| 461 | } |
| 462 | |
| 463 | static int stop_waiting(Lua L, dbconsumer_t *q) |
| 464 | { |
| 465 | if (check_retry_conditions(L, &q->info, 0) != 0) |
| 466 | return 1; |
| 467 | time_t now = time(NULL); |
| 468 | if (difftime(now, q->registration_time) <= 0) { |
| 469 | return 0; |
| 470 | } |
| 471 | SP sp = getsp(L); |
| 472 | if (sp->pingpong == 2) { |
| 473 | return 0; |
| 474 | } |
| 475 | if (luabb_trigger_register(L, &q->info, q->register_timeoutms) != |
| 476 | CDB2_TRIG_REQ_SUCCESS) |
| 477 | return 1; |
| 478 | q->registration_time = time(NULL); |
| 479 | return 0; |
| 480 | } |
| 481 | |
| 482 | static void ping(Lua L) |
| 483 | { |
no test coverage detected