Skip to content
Snippets Groups Projects
Commit 3a8f73ad authored by Rhys Arkins's avatar Rhys Arkins
Browse files

chore: better debugging for timezone/schedule

parent 2f6aac0b
No related branches found
No related tags found
No related merge requests found
......@@ -53,7 +53,10 @@ function hasValidSchedule(schedule) {
function isScheduledNow(config) {
let configSchedule = config.schedule;
logger.debug({ schedule: configSchedule }, `Checking schedule`);
logger.debug(
{ schedule: configSchedule, timezone: config.timezone },
`Checking schedule`
);
if (
!configSchedule ||
configSchedule.length === 0 ||
......@@ -77,11 +80,13 @@ function isScheduledNow(config) {
logger.debug(`now=${now.format()}`);
// Adjust the time if repo is in a different timezone to renovate
if (config.timezone) {
logger.debug({ timezone: config.timezone }, 'Found timezone');
const [validTimezone, error] = hasValidTimezone(config.timezone);
if (!validTimezone) {
logger.warn(error);
return true;
}
logger.debug('Adjusting now for timezone');
now = now.tz(config.timezone);
logger.debug(`now=${now.format()}`);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment