mirror of
https://github.com/lifegpc/pixiv_downloader.git
synced 2026-07-08 01:32:41 +08:00
Add a timer to revoke all expired tokens( Fix #279
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user