Browse code

modules_k/rls: Improved check for expired subscriptions in DB only mode

Peter Dunkley authored on 11/09/2012 12:09:22
Showing 1 changed files
... ...
@@ -116,7 +116,7 @@ int delete_expired_subs_rlsdb( void )
116 116
 {
117 117
 	db_key_t query_cols[3], result_cols[3], update_cols[1];
118 118
 	db_val_t query_vals[3], update_vals[1], *values;
119
-	db_op_t query_ops[1];
119
+	db_op_t query_ops[2];
120 120
 	db_row_t *rows;
121 121
 	db1_res_t *result = NULL;
122 122
 	int n_query_cols = 0, n_result_cols = 0;
... ...
@@ -145,6 +145,13 @@ int delete_expired_subs_rlsdb( void )
145 145
 	query_ops[n_query_cols]= OP_LT;
146 146
 	n_query_cols++;
147 147
 
148
+	query_cols[n_query_cols]= &str_updated_col;
149
+	query_vals[n_query_cols].type = DB1_INT;
150
+	query_vals[n_query_cols].nul = 0;
151
+	query_vals[n_query_cols].val.int_val= NO_UPDATE_TYPE;
152
+	query_ops[n_query_cols]= OP_EQ;
153
+	n_query_cols++;
154
+
148 155
 	result_cols[r_callid_col=n_result_cols++] = &str_callid_col;
149 156
 	result_cols[r_to_tag_col=n_result_cols++] = &str_to_tag_col;
150 157
 	result_cols[r_from_tag_col=n_result_cols++] = &str_from_tag_col;