File tree 3 files changed +11
-5
lines changed
3 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -84,6 +84,8 @@ pub async fn run_cli() {
84
84
setup_logging ( & args. log , args. log_file ) ;
85
85
setup_caching ( & args. cache ) ;
86
86
87
+ let version_check = tokio:: spawn ( check_version ( env ! ( "CARGO_PKG_VERSION" ) ) ) ;
88
+
87
89
// Match and run subcommand
88
90
let result = match args. command {
89
91
Commands :: Bin { tool } => bin ( tool) . await ,
@@ -287,14 +289,14 @@ pub async fn run_cli() {
287
289
288
290
// Defer checking for a new version as it requires the workspace root
289
291
// to exist. Otherwise, the `init` command would panic while checking!
290
- match check_version ( env ! ( "CARGO_PKG_VERSION" ) ) . await {
291
- Ok ( ( newer_version, true ) ) => {
292
+ match version_check . await {
293
+ Ok ( Ok ( ( newer_version, true ) ) ) => {
292
294
println ! (
293
295
"There's a new version of moon! {newer_version}\n \
294
296
Run `moon upgrade` or install from https://moonrepo.dev/docs/install",
295
297
) ;
296
298
}
297
- Err ( error) => {
299
+ Ok ( Err ( error) ) => {
298
300
debug ! ( target: "moon:cli" , "Failed to check for current version: {}" , error) ;
299
301
}
300
302
_ => { }
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ use std::time::{Duration, SystemTime};
12
12
use uuid:: Uuid ;
13
13
14
14
const CURRENT_VERSION_URL : & str = "https://launch.moonrepo.app/versions/cli/current" ;
15
- const ALERT_PAUSE_DURATION : Duration = Duration :: from_secs ( 28800 ) ; // 8 hours
15
+ const ALERT_PAUSE_DURATION : Duration = Duration :: from_secs ( 43200 ) ; // 12 hours
16
16
17
17
#[ derive( Debug , Deserialize , Serialize ) ]
18
18
pub struct CurrentVersion {
@@ -63,7 +63,7 @@ pub async fn check_version(
63
63
let check_state_path = moon_dir. join ( "cache/states/versionCheck.json" ) ;
64
64
let now = SystemTime :: now ( ) ;
65
65
66
- // Only check once every 8 hours
66
+ // Only check once every 12 hours
67
67
if let Ok ( file) = fs:: read ( & check_state_path) {
68
68
let check_state: Result < CheckState , _ > = serde_json:: from_str ( & file) ;
69
69
Original file line number Diff line number Diff line change 6
6
7
7
- Fixed an issue where workspace relative ` outputs ` were not being included in the hashed tarball.
8
8
9
+ #### ⚙️ Internal
10
+
11
+ - Reduced new version check to once every 12 hours.
12
+
9
13
## 0.25.2
10
14
11
15
#### 🐞 Fixes
You can’t perform that action at this time.
0 commit comments