File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed
crates/stackable-operator/src/eos Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -82,12 +82,18 @@ impl EndOfSupportChecker {
8282 ..
8383 } = options;
8484
85- // Parse the built-time from the RFC2822-encoded string and add the support duration to it.
86- // This is datetime marks the end-of-support date.
87- let datetime = DateTime :: parse_from_rfc2822 ( built_time)
88- . context ( ParseBuiltTimeSnafu ) ?
89- . to_utc ( )
90- + * support_duration;
85+ // Parse the built-time from the RFC2822-encoded string when this is compiled as a release
86+ // build. If this is a debug/dev build, use the current datetime instead.
87+ let mut datetime = if cfg ! ( debug_assertions) {
88+ Utc :: now ( )
89+ } else {
90+ DateTime :: parse_from_rfc2822 ( built_time)
91+ . context ( ParseBuiltTimeSnafu ) ?
92+ . to_utc ( )
93+ } ;
94+
95+ // Add the support duration to the built date. This marks the end-of-support date.
96+ datetime += * support_duration;
9197
9298 Ok ( Self { datetime, interval } )
9399 }
You can’t perform that action at this time.
0 commit comments