Skip to content

Commit

Permalink
sp
Browse files Browse the repository at this point in the history
  • Loading branch information
nkonev committed Jan 12, 2024
1 parent 2521d40 commit 883c6e1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions video/services/dial_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func chatIdFromKey(key string) (int64, error) {

// TODO here and in RemoveAllDials() not to remove immediately, but switch status and set expiration on user_call_status key equal to "room is closing" timeout
func (s *DialRedisRepository) RemoveFromDialList(ctx context.Context, userId, chatId int64) error {
_, err := s.redisClient.SRem(ctx, dialChatMembersKey(chatId), userId).Result()
_, err := s.redisClient.SRem(ctx, dialChatMembersKey(chatId), userId).Result() // TODO instead of it - just change status on "canceling"
if err != nil {
logger.GetLogEntry(ctx).Errorf("Error during performing SREM %v", err)
return err
Expand All @@ -112,7 +112,7 @@ func (s *DialRedisRepository) RemoveFromDialList(ctx context.Context, userId, ch
logger.GetLogEntry(ctx).Errorf("Error during performing SCARD %v", err)
return err
}
if card == 0 { // TODO paraphrase this logic (most probably put it in scheduler) to run periodically, and if all the clients were removed - then run...
if card == 0 { // TODO create run periodically task, which checks if there are any active calls (dialChatMembersKey) by chatId and if zero - then remove the entire construction
// remove "dialchat" on zero members
err = s.redisClient.Del(ctx, dialChatMembersKey(chatId)).Err()
if err != nil {
Expand Down

0 comments on commit 883c6e1

Please sign in to comment.