Feat: allow request time for 'night'
This commit is contained in:
@@ -238,13 +238,25 @@ public class Worker {
|
|||||||
config.getRequestTime().add(new Pair<Calendar, Calendar>(start, end));
|
config.getRequestTime().add(new Pair<Calendar, Calendar>(start, end));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
System.err.println(String.format("ERROR: The start (%s) time must be earlier than the finish (%s) time", times[0], times[1]));
|
// example: for a night render, 20:00,07:00 we will create 2 intervals for it: 20:00-23:59 and 00:00-07:00
|
||||||
|
try {
|
||||||
|
Calendar midnightBefore = Calendar.getInstance();
|
||||||
|
midnightBefore.setTime(timeFormat.parse("23:59"));
|
||||||
|
Calendar midnightAfter = Calendar.getInstance();
|
||||||
|
midnightAfter.setTime(timeFormat.parse("00:00"));
|
||||||
|
|
||||||
|
config.getRequestTime().add(new Pair<Calendar, Calendar>(start, midnightBefore));
|
||||||
|
config.getRequestTime().add(new Pair<Calendar, Calendar>(midnightAfter, end));
|
||||||
|
}
|
||||||
|
catch (ParseException e) {
|
||||||
|
System.err.println("Failed to parse date");
|
||||||
System.exit(2);
|
System.exit(2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (nb_cores < -1 || nb_cores == 0) { // -1 is the default
|
if (nb_cores < -1 || nb_cores == 0) { // -1 is the default
|
||||||
System.err.println("ERROR: The entered number of CPU cores (-cores parameter) is not valid. Please enter a number greater than zero");
|
System.err.println("ERROR: The entered number of CPU cores (-cores parameter) is not valid. Please enter a number greater than zero");
|
||||||
|
|||||||
Reference in New Issue
Block a user