Forgot that I still had everything hard-coded to central time. Changed it to be configurable per account.

This commit is contained in:
Mark Milligan
2021-01-16 21:15:07 -06:00
parent 98d1f0168c
commit 3d7f116baa
10 changed files with 103 additions and 38 deletions

View File

@@ -26,7 +26,7 @@ public class RebuildSummaries {
public static void main(String[] args) {
int accountId = 1;
CurrentMonitorDao dao = new MongoCurrentMonitorDao(MongoConfig.fromDisk(LanternFiles.OPS_PATH + "mongo.cfg"));
TimeZone tz = TimeZone.getTimeZone("America/Chicago");
TimeZone tz = dao.getTimeZoneForAccount(accountId);
Date start = DateUtils.date(1, 7, 2021, tz);
// Date start = DateUtils.getMidnightBeforeNow(tz);
Date end = DateUtils.getMidnightAfterNow(tz);
@@ -49,7 +49,7 @@ public class RebuildSummaries {
if (energy == null)
energy = new BreakerGroupEnergy(root, minute, EnergyBlockViewMode.DAY, day.getKey(), tz);
else
energy.addEnergy(breakers, breakerKeyToGroup, minute, tz);
energy.addEnergy(breakers, breakerKeyToGroup, minute);
}
timer.stop();
if (energy != null)