automatically cleanup participant redis data

This commit is contained in:
David Zhao
2021-01-18 17:56:48 -08:00
parent 834a4747ac
commit d83a1b1af3
15 changed files with 262 additions and 59 deletions
+4
View File
@@ -2,6 +2,7 @@ package service
import (
"sync"
"time"
"github.com/thoas/go-funk"
@@ -26,6 +27,9 @@ func NewLocalRoomStore() *LocalRoomStore {
}
func (p *LocalRoomStore) CreateRoom(room *livekit.Room) error {
if room.CreationTime == 0 {
room.CreationTime = time.Now().Unix()
}
p.lock.Lock()
p.rooms[room.Sid] = room
p.roomIds[room.Name] = room.Sid