From 2925cf50927aded02ad76cdc4f34d221306ba1f9 Mon Sep 17 00:00:00 2001 From: Eric Harding Date: Mon, 11 Feb 2019 16:10:51 -0500 Subject: [PATCH] CR Feedback --- src/lib/config/defaults/MarketData.conf | 7 +++++++ src/lib/utils/datetime.cpp | 15 ++++----------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/lib/config/defaults/MarketData.conf b/src/lib/config/defaults/MarketData.conf index 0a11b62c6..08603497a 100644 --- a/src/lib/config/defaults/MarketData.conf +++ b/src/lib/config/defaults/MarketData.conf @@ -35,6 +35,13 @@ CMEOptions { } } +MDBootDelayWindow { + rule: "DeploymentType.type == 'dev'" + value { + delay_seconds: 0 + } +} + MDBootDelayWindow { value { delay_seconds: 120 diff --git a/src/lib/utils/datetime.cpp b/src/lib/utils/datetime.cpp index 4cd7fe092..8c33965e4 100755 --- a/src/lib/utils/datetime.cpp +++ b/src/lib/utils/datetime.cpp @@ -324,20 +324,13 @@ bool is_local_time_sunday() { return now.date().day_of_week() == boost::date_time::Sunday; } bool is_local_time_between(int hh_start, int mm_start, int hh_end, int mm_end) { + using namespace boost::posix_time; auto now = local_now(); - auto hh_now = now.time_of_day().hours(); - auto mm_now = now.time_of_day().minutes(); - - if (hh_now > hh_start && hh_now < hh_end) return true; - if (hh_now == hh_start || hh_now == hh_end) { - if (mm_now >= mm_start && mm_now <= mm_end) { - return true; - } - } - return false; + auto start = ptime(now.date(), hours(hh_start) + minutes(mm_start)); + auto end = ptime(now.date(), hours(hh_end) + minutes(mm_end)); + return (now >= start && now <= end); } - struct UtcTimeStamp { int hour; int min;