-
-
Notifications
You must be signed in to change notification settings - Fork 622
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c8fa8e8
commit 15d948e
Showing
20 changed files
with
648 additions
and
310 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,14 @@ | ||
use std::time::{SystemTime, UNIX_EPOCH}; | ||
use rspack_paths::Utf8PathBuf; | ||
|
||
#[derive(Debug)] | ||
pub struct PackOptions { | ||
pub bucket_size: usize, | ||
pub pack_size: usize, | ||
pub expire: u64, | ||
} | ||
|
||
impl PackOptions { | ||
pub fn is_expired(&self, last_modified: &u64) -> bool { | ||
let current_time = SystemTime::now() | ||
.duration_since(UNIX_EPOCH) | ||
.expect("get current time failed") | ||
.as_millis() as u64; | ||
current_time - last_modified > self.expire | ||
} | ||
#[derive(Debug)] | ||
pub struct RootOptions { | ||
pub root: Utf8PathBuf, | ||
pub expire: u64, | ||
pub clean: bool, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
15d948e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 Benchmark detail: Open
15d948e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 Ran ecosystem CI: Open