Merge pull request #2803 from ritzalam/expire-redis-key
- expire redis keys for events that are stored even if meeting is no…
This commit is contained in:
commit
49014d4b12
@ -37,7 +37,16 @@ public class EventRecordingService {
|
||||
public void record(String meetingId, Map<String, String> event) {
|
||||
Jedis jedis = new Jedis(host, port);
|
||||
Long msgid = jedis.incr("global:nextRecordedMsgId");
|
||||
jedis.hmset("recording:" + meetingId + COLON + msgid, event);
|
||||
jedis.rpush("meeting:" + meetingId + COLON + "recordings", msgid.toString());
|
||||
String key = "recording:" + meetingId + COLON + msgid;
|
||||
jedis.hmset(key, event);
|
||||
/**
|
||||
* We set the key to expire after 14 days as we are still
|
||||
* recording the event into redis even if the meeting is not
|
||||
* recorded. (ralam sept 23, 2015)
|
||||
*/
|
||||
jedis.expire(key, 14*24*60*60 /*14days*/);
|
||||
key = "meeting:" + meetingId + COLON + "recordings";
|
||||
jedis.rpush(key, msgid.toString());
|
||||
jedis.expire(key, 14*24*60*60 /*14days*/);
|
||||
}
|
||||
}
|
||||
|
16
deskshare/app/src/main/java/org/bigbluebutton/deskshare/server/recorder/EventRecorder.java
Normal file → Executable file
16
deskshare/app/src/main/java/org/bigbluebutton/deskshare/server/recorder/EventRecorder.java
Normal file → Executable file
@ -19,14 +19,13 @@
|
||||
package org.bigbluebutton.deskshare.server.recorder;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.bigbluebutton.deskshare.server.recorder.event.AbstractDeskshareRecordEvent;
|
||||
import org.bigbluebutton.deskshare.server.recorder.event.RecordEvent;
|
||||
import org.bigbluebutton.deskshare.server.recorder.event.RecordStartedEvent;
|
||||
import org.bigbluebutton.deskshare.server.recorder.event.RecordStoppedEvent;
|
||||
|
||||
import redis.clients.jedis.Jedis;
|
||||
|
||||
|
||||
public class EventRecorder implements RecordStatusListener {
|
||||
private static final String COLON=":";
|
||||
private String host;
|
||||
@ -44,8 +43,17 @@ public class EventRecorder implements RecordStatusListener {
|
||||
private void record(String session, RecordEvent message) {
|
||||
Jedis jedis = new Jedis(host, port);
|
||||
Long msgid = jedis.incr("global:nextRecordedMsgId");
|
||||
jedis.hmset("recording" + COLON + session + COLON + msgid, message.toMap());
|
||||
jedis.rpush("meeting" + COLON + session + COLON + "recordings", msgid.toString());
|
||||
String key = "recording" + COLON + session + COLON + msgid;
|
||||
jedis.hmset(key, message.toMap());
|
||||
/**
|
||||
* We set the key to expire after 14 days as we are still
|
||||
* recording the event into redis even if the meeting is not
|
||||
* recorded. (ralam sept 23, 2015)
|
||||
*/
|
||||
jedis.expire(key, 14*24*60*60 /*14days*/);
|
||||
key = "meeting" + COLON + session + COLON + "recordings";
|
||||
jedis.rpush(key, msgid.toString());
|
||||
jedis.expire(key, 14*24*60*60 /*14days*/);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user