Skip to content

Commit

Permalink
doc: logging improvement and readme
Browse files Browse the repository at this point in the history
  • Loading branch information
kagkarlsson committed Mar 11, 2024
1 parent d422cfb commit cadf433
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,10 @@ How often the scheduler checks the database for due executions. Default `10s`.<b
The Scheduler assumes that columns for persisting timestamps persist `Instant`s, not `LocalDateTime`s,
i.e. somehow tie the timestamp to a zone. However, some databases have limited support for such types
(which has no zone information) or other quirks, making "always store in UTC" a better alternative.
Databases that always persist in UTC are: ...TODO
To force ..
Currently, only PostgreSQL and Oracle rely on the database preserving time zone information,
other databases store timestamps in UTC. **NB:** For backwards compatibility, the default behavior
for "unknown" databases is to assume the database preserves time zone. For "known" databases,
see the class `AutodetectJdbcCustomization`.

:gear: `.enableImmediateExecution()`<br/>
If this is enabled, the scheduler will attempt to hint to the local `Scheduler` that there are executions to be executed after they are scheduled to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,18 @@ public AutodetectJdbcCustomization(DataSource dataSource, boolean persistTimesta
+ "to be of type compatibe with 'TIMESTAMP WITH TIME ZONE', i.e. zone is persisted."
+ " If not, consider overriding to always UTC via '.alwaysPersistTimestampInUTC()'.");
}
} else {
if (persistTimestampInUTC) {
LOG.info(
"No database-specific jdbc-overrides applied. Behavior overridden to always store "
+ "timestamps in zone UTC");
} else {
Logger silencableLogger = LoggerFactory.getLogger(LOG.getName() + ".utc_warning");
silencableLogger.warn(
"No database-specific jdbc-overrides applied. Assuming time-related columns "
+ "to be of type compatibe with 'TIMESTAMP WITH TIME ZONE', i.e. zone is persisted."
+ " If not, consider overriding to always UTC via '.alwaysPersistTimestampInUTC()'.");
}
}

} catch (SQLException e) {
Expand Down

0 comments on commit cadf433

Please sign in to comment.