diff --git a/src/amqp.c b/src/amqp.c
index c9e46c45df0cac7ef0e0cc4f3bdd2e1bda8ad96e..9c8c6e537c6cb1d2f3907402f7c602e2f8b326b6 100644 (file)
--- a/src/amqp.c
+++ b/src/amqp.c
camqp_config_t *conf = user_data;
int status;
+ cdtime_t interval = plugin_get_interval ();
+
while (subscriber_threads_running)
{
amqp_frame_t frame;
struct timespec ts_interval;
ERROR ("amqp plugin: camqp_connect failed. "
"Will sleep for %.3f seconds.",
- CDTIME_T_TO_DOUBLE (interval_g));
- CDTIME_T_TO_TIMESPEC (interval_g, &ts_interval);
+ CDTIME_T_TO_DOUBLE (interval));
+ CDTIME_T_TO_TIMESPEC (interval, &ts_interval);
nanosleep (&ts_interval, /* remaining = */ NULL);
continue;
}
struct timespec ts_interval;
ERROR ("amqp plugin: amqp_simple_wait_frame failed. "
"Will sleep for %.3f seconds.",
- CDTIME_T_TO_DOUBLE (interval_g));
+ CDTIME_T_TO_DOUBLE (interval));
camqp_close_connection (conf);
- CDTIME_T_TO_TIMESPEC (interval_g, &ts_interval);
+ CDTIME_T_TO_TIMESPEC (interval, &ts_interval);
nanosleep (&ts_interval, /* remaining = */ NULL);
continue;
}
tmp = subscriber_threads + subscriber_threads_num;
memset (tmp, 0, sizeof (*tmp));
- status = pthread_create (tmp, /* attr = */ NULL,
+ status = plugin_thread_create (tmp, /* attr = */ NULL,
camqp_subscribe_thread, conf);
if (status != 0)
{