Skip to content

Commit

Permalink
MT#55283 restore selected DB after delete
Browse files Browse the repository at this point in the history
Deleting a call can have the side effect of changing the active Redis DB
on the writing instance. Restore the correct DB afterwards if needed.

Fixes #1905

Change-Id: I12dae767ffa5d25703e024d2ec59aa21ba9da101
(cherry picked from commit fdabc9b)
(cherry picked from commit 6df71f2)
  • Loading branch information
rfuchs committed Jan 24, 2025
1 parent 0d160bb commit a709415
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions daemon/redis.c
Original file line number Diff line number Diff line change
Expand Up @@ -2229,6 +2229,8 @@ static void json_restore_call(struct redis *r, const str *callid, bool foreign)
redis_ports_release_pop(false);
must_release_pop = false;

redis_select_db(rtpe_redis_write, rtpe_redis_write->db);

mutex_lock(&rtpe_redis_write->lock);
redisCommandNR(rtpe_redis_write->ctx, "DEL " PB, PBSTR(callid));
mutex_unlock(&rtpe_redis_write->lock);
Expand Down

0 comments on commit a709415

Please sign in to comment.