mirror of https://github.com/calzoneman/sync.git
Fix incorrect clearing of visit history
This commit is contained in:
parent
08dabeda59
commit
55e6734bd1
|
@ -923,12 +923,12 @@ function recordVisit(ip, name) {
|
|||
|
||||
// Keep most recent 5 records per IP
|
||||
results = db.querySync(createQuery(
|
||||
["DELETE FROM aliases WHERE visit_id NOT IN (",
|
||||
["DELETE FROM aliases WHERE ip=? AND visit_id NOT IN (",
|
||||
"SELECT visit_id FROM (",
|
||||
"SELECT visit_id,time FROM aliases WHERE ip=? ORDER BY time DESC LIMIT 5",
|
||||
") foo",
|
||||
");"].join(""),
|
||||
[ip]
|
||||
[ip, ip]
|
||||
));
|
||||
|
||||
return results;
|
||||
|
|
Loading…
Reference in New Issue