Skip to content

Commit

Permalink
Fix transaction state vacuum in MQTT transport (#2358)
Browse files Browse the repository at this point in the history
  • Loading branch information
feymartynov committed Sep 14, 2020
1 parent a8e0470 commit 6c18ee0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion transports/janus_mqtt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1612,7 +1612,8 @@ static gboolean janus_mqtt_vacuum(gpointer context) {

while (g_hash_table_iter_next(&iter, NULL, &value)) {
janus_mqtt_transaction_state* state = value;
if(janus_get_monotonic_time() - state->created_at > ctx->vacuum_interval) {
gint64 diff = (janus_get_monotonic_time() - state->created_at) / G_USEC_PER_SEC;
if(diff > ctx->vacuum_interval) {
g_hash_table_iter_remove(&iter);
}
}
Expand Down

0 comments on commit 6c18ee0

Please sign in to comment.