Add a timer to revoke all expired tokens( Fix #279

This commit is contained in:
2022-09-29 01:30:03 +00:00
committed by GitHub
parent 677cc576cf
commit fcff540220
8 changed files with 80 additions and 5 deletions

View File

@@ -55,6 +55,23 @@ impl GetMaxCount for MaxDownloadPostTasks {
}
}
#[derive(Clone, Debug)]
pub struct MaxCount {
max_count: usize,
}
impl MaxCount {
pub fn new(max_count: usize) -> Self {
MaxCount { max_count }
}
}
impl GetMaxCount for MaxCount {
fn get_max_count(&self) -> usize {
self.max_count
}
}
/// Task manager
pub struct TaskManager<T> {
/// Current running task