File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ use crate::config::Config;
4343) ) ]
4444use crate :: config:: { self , CacheType } ;
4545use async_trait:: async_trait;
46+ use chrono:: Local ;
4647use fs_err as fs;
4748
4849use serde:: { Deserialize , Serialize } ;
@@ -490,7 +491,11 @@ impl Storage for opendal::Operator {
490491 async fn check ( & self ) -> Result < CacheMode > {
491492 use opendal:: ErrorKind ;
492493
493- let path = ".sccache_check" ;
494+ // Use a unique name for path so that we don't have to grant overwrite permissions
495+ // on the bucket.
496+ let formatted_time = Local :: now ( ) . format ( "%Y_%m_%d_%H_%M_%S%.3f" ) . to_string ( ) ;
497+ let combined = format ! ( ".sccache_check_{formatted_time}" ) ;
498+ let path: & str = combined. as_str ( ) ;
494499
495500 // Read is required, return error directly if we can't read .
496501 match self . read ( path) . await {
You can’t perform that action at this time.
0 commit comments