static void afmongodb_dd_queue_method(LogThrDestDriver *d) { MongoDBDestDriver *self = (MongoDBDestDriver *)d; self->last_msg_stamp = cached_g_current_time_sec (); }
static void afmongodb_dd_queue(LogPipe *s, LogMessage *msg, const LogPathOptions *path_options, gpointer user_data) { MongoDBDestDriver *self = (MongoDBDestDriver *)s; gboolean queue_was_empty; LogPathOptions local_options; if (!path_options->flow_control_requested) path_options = log_msg_break_ack(msg, path_options, &local_options); g_mutex_lock(self->queue_mutex); self->last_msg_stamp = cached_g_current_time_sec (); queue_was_empty = log_queue_get_length(self->queue) == 0; g_mutex_unlock(self->queue_mutex); log_msg_add_ack(msg, path_options); log_queue_push_tail(self->queue, log_msg_ref(msg), path_options); g_mutex_lock(self->suspend_mutex); if (queue_was_empty && !self->writer_thread_suspended) { g_mutex_lock(self->queue_mutex); log_queue_set_parallel_push(self->queue, 1, afmongodb_dd_queue_notify, self, NULL); g_mutex_unlock(self->queue_mutex); } g_mutex_unlock(self->suspend_mutex); log_dest_driver_queue_method(s, msg, path_options, user_data); }
static void affile_dw_reap(gpointer s) { AFFileDestWriter *self = (AFFileDestWriter *) s; main_loop_assert_main_thread(); g_static_mutex_lock(&self->lock); if (!log_writer_has_pending_writes(self->writer) && !self->queue_pending && (cached_g_current_time_sec() - self->last_msg_stamp) >= self->owner->time_reap) { g_static_mutex_unlock(&self->lock); msg_verbose("Destination timed out, reaping", evt_tag_str("template", self->owner->filename_template->template),
static void afmongodb_dd_queue(LogPipe *s, LogMessage *msg, const LogPathOptions *path_options, gpointer user_data) { MongoDBDestDriver *self = (MongoDBDestDriver *)s; LogPathOptions local_options; if (!path_options->flow_control_requested) path_options = log_msg_break_ack(msg, path_options, &local_options); self->last_msg_stamp = cached_g_current_time_sec (); log_msg_add_ack(msg, path_options); log_queue_push_tail(self->queue, log_msg_ref(msg), path_options); log_dest_driver_queue_method(s, msg, path_options, user_data); }