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 {
82
82
..
83
83
} = options;
84
84
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;
91
97
92
98
Ok ( Self { datetime, interval } )
93
99
}
You can’t perform that action at this time.
0 commit comments