Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions code/processes/reporter.q
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ runreport:{[tab]
`..timerids upsert 1!select id,periodend:nextrun from .timer.timer where fp~/:funcparam;
:()];
/ - if timezone is specified convert the start and end timestamps to the time used by the system
startts:?[not null tab[`timezone];.tz.ttz[`GMT;tab[`timezone];gtime[startts]];startts];
endts:?[not null tab[`timezone];.tz.ttz[`GMT;tab[`timezone];gtime[endts]];endts];
startts:?[not null tab[`timezone];.tz.ttz[`GMT;tab[`timezone];?[`localtime in .proc.params;gtime[startts];startts]];startts];
endts:?[not null tab[`timezone];.tz.ttz[`GMT;tab[`timezone];?[`localtime in .proc.params;gtime[endts];endts]];endts];
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can just check .proc.localtime here, and probably use $ instead of ?

Suggested change
startts:?[not null tab[`timezone];.tz.ttz[`GMT;tab[`timezone];?[`localtime in .proc.params;gtime[startts];startts]];startts];
endts:?[not null tab[`timezone];.tz.ttz[`GMT;tab[`timezone];?[`localtime in .proc.params;gtime[endts];endts]];endts];
startts:?[not null tab[`timezone];.tz.ttz[`GMT;tab[`timezone];$[.proc.localtime;gtime[startts];startts]];startts];
endts:?[not null tab[`timezone];.tz.ttz[`GMT;tab[`timezone];$[.proc.localtime;gtime[endts];endts]];endts];

/ - if the current time is within the start and end timestamps, use current time as start time, else use the startts
/ - work out the start time for the timer. For example a report could run every day from 10am to 6pm every 5 mins, if the reporter
/ - is started at 1:11pm, we need to know that the report should start 1:15pm and then run every 5 mins there after
Expand Down