mirror of
https://git.asonix.dog/asonix/background-jobs.git
synced 2024-11-28 06:50:59 +00:00
Tick before increment, tick on fetch
This commit is contained in:
parent
c6682d2fc9
commit
2fea1e8e69
1 changed files with 7 additions and 4 deletions
|
@ -852,10 +852,13 @@ impl Stat {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn inner_stat(self) -> JobStat {
|
fn inner_stat(self) -> JobStat {
|
||||||
match self {
|
let mut job_stat = match self {
|
||||||
Stat::DeadJobs(job_stat) => job_stat,
|
Stat::DeadJobs(job_stat) => job_stat,
|
||||||
Stat::CompletedJobs(job_stat) => job_stat,
|
Stat::CompletedJobs(job_stat) => job_stat,
|
||||||
}
|
};
|
||||||
|
|
||||||
|
job_stat.tick();
|
||||||
|
job_stat
|
||||||
}
|
}
|
||||||
|
|
||||||
fn dead_jobs() -> &'static str {
|
fn dead_jobs() -> &'static str {
|
||||||
|
@ -898,12 +901,12 @@ impl JobStat {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn increment(&mut self) {
|
fn increment(&mut self) {
|
||||||
|
self.tick();
|
||||||
|
|
||||||
self.this_hour += 1;
|
self.this_hour += 1;
|
||||||
self.today += 1;
|
self.today += 1;
|
||||||
self.this_month += 1;
|
self.this_month += 1;
|
||||||
self.all_time += 1;
|
self.all_time += 1;
|
||||||
|
|
||||||
self.tick();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn tick(&mut self) {
|
fn tick(&mut self) {
|
||||||
|
|
Loading…
Reference in a new issue