update page_visits.rs
This commit is contained in:
parent
2b22d38cce
commit
11fc4b95fc
1 changed files with 2 additions and 1 deletions
|
|
@ -39,7 +39,7 @@ fn increment_visitor(path: PathBuf, visitor_stats: Vec<Visitor>, visits_total: i
|
|||
|
||||
fn check_count_cooldown(path: PathBuf, remote_address: String) -> i32 {
|
||||
let mut visitor = Visitor {
|
||||
address: remote_address,
|
||||
address: remote_address.clone(),
|
||||
recent_visit: SystemTime::now(),
|
||||
visit_count: 0,
|
||||
};
|
||||
|
|
@ -74,6 +74,7 @@ fn check_count_cooldown(path: PathBuf, remote_address: String) -> i32 {
|
|||
.expect("error parsing past visitor location in json");
|
||||
visitor_stats.remove(index);
|
||||
visitor_stats.push(visitor);
|
||||
println!("|incrementing page visits for user from {}", remote_address);
|
||||
increment_visitor(path, visitor_stats, visit_count);
|
||||
} else {
|
||||
// not counting too-fast return visit
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue