forked from j62/ctbrec
Merge branch 'dev' into cam4
This commit is contained in:
commit
c8e3db4021
|
@ -1,3 +1,7 @@
|
||||||
|
1.6.1
|
||||||
|
========================
|
||||||
|
* Fixed UI freeze, which occured for a high number of recorded models
|
||||||
|
|
||||||
1.6.0
|
1.6.0
|
||||||
========================
|
========================
|
||||||
* Added support for multiple cam sites
|
* Added support for multiple cam sites
|
||||||
|
|
|
@ -166,7 +166,12 @@ public class LocalRecorder implements Recorder {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Model> getModelsRecording() {
|
public List<Model> getModelsRecording() {
|
||||||
return Collections.unmodifiableList(new ArrayList<>(models));
|
lock.lock();
|
||||||
|
try {
|
||||||
|
return Collections.unmodifiableList(new ArrayList<>(models));
|
||||||
|
} finally {
|
||||||
|
lock.unlock();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -308,24 +313,19 @@ public class LocalRecorder implements Recorder {
|
||||||
public void run() {
|
public void run() {
|
||||||
running = true;
|
running = true;
|
||||||
while (running) {
|
while (running) {
|
||||||
lock.lock();
|
for (Model model : getModelsRecording()) {
|
||||||
try {
|
try {
|
||||||
for (Model model : getModelsRecording()) {
|
if (!recordingProcesses.containsKey(model)) {
|
||||||
try {
|
boolean isOnline = model.isOnline(IGNORE_CACHE);
|
||||||
if (!recordingProcesses.containsKey(model)) {
|
LOG.trace("Checking online state for {}: {}", model, (isOnline ? "online" : "offline"));
|
||||||
boolean isOnline = model.isOnline(IGNORE_CACHE);
|
if (isOnline) {
|
||||||
LOG.trace("Checking online state for {}: {}", model, (isOnline ? "online" : "offline"));
|
LOG.info("Model {}'s room back to public. Starting recording", model);
|
||||||
if (isOnline) {
|
startRecordingProcess(model);
|
||||||
LOG.info("Model {}'s room back to public. Starting recording", model);
|
|
||||||
startRecordingProcess(model);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
|
||||||
LOG.error("Couldn't check if model {} is online", model.getName(), e);
|
|
||||||
}
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
LOG.error("Couldn't check if model {} is online", model.getName(), e);
|
||||||
}
|
}
|
||||||
} finally {
|
|
||||||
lock.unlock();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in New Issue