Details
Description
When a weekly session is configured, quickfixj would stop and start sessions on other weekdays than the one configured. In my particular case I have a session that is reset on a Friday afternoon, so quickfixj was configured for a weekly session lasting from Friday 16:00 to Friday next week 13:00. Errors in the calculation made it log out, reset and log in on other weekdays as well.
Here are suggested code changes:
SessionSchedule.java line 221:
int time1Range = timestamp1.get(Calendar.DAY_OF_WEEK) - startDay;
int time2Range = timestamp2.get(Calendar.DAY_OF_WEEK) - startDay;
if (time1Range == 0) {
Calendar timeOnly = getTimeOnly(timestamp1, calendar1);
if (timeOnly.before(startTime))
- } else if (time1Range < 0) { * time1Range +=7 ; }
if (time2Range == 0) {
Calendar timeOnly = getTimeOnly(timestamp2, calendar2);
if (timeOnly.before(startTime))
- } else if (time2Range < 0) { * time2Range +=7 ; }
SessionSchedule.java line 262:
if (startDay == endDay) {
- //Session can go from 13:00-15:00 or from 15:00 - 13:00 ( incl. 7 days)
- if (startTime.before(endTime))
{
* if (currentDay != startDay || currentTime.before(startTime) || currentTime.after(endTime))
* return false;
* }
else
{ * if (currentDay == startDay && currentTime.before(startTime) && currentTime.after(endTime)) * return false; * }
} else if (startDay < endDay) {
Christian