Opened 4 years ago

Closed 4 years ago

#2783 closed change (fixed)

Establish cron-job to clean up Trac fake accounts

Reported by: matze Assignee: matze
Priority: P2 Milestone:
Module: Infrastructure Keywords:
Cc: fred, trev Blocked By: #2586, #2849
Blocking: Platform: Unknown / Cross platform
Ready: yes Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

https://codereview.adblockplus.org/29323184

Description (last modified by matze)

In order to continuously clean out fake account records from Trac (see #2586), the following SQL query should become executed daily:

DELETE
    session,
    session_attribute
FROM
    session
JOIN
    session_attribute AS session_check ON
    session.sid = session_check.sid AND
    session.authenticated = session_check.authenticated
JOIN
    session_attribute ON
    session.sid = session_attribute.sid AND
    session.authenticated = session_attribute.authenticated
WHERE
    session_check.name = "email_verification_token" AND
    session.last_visit < UNIX_TIMESTAMP(NOW() - INTERVAL 5 DAY)
;

Change History (8)

comment:1 Changed 4 years ago by matze

  • Cc fred added; fhd trev removed

comment:2 Changed 4 years ago by trev

  • Cc trev added

This query looks like it would remove every account that wasn't touched for five days. Do I understand correctly that session_check.name = "email_verification_token" applies only to accounts where email validation didn't succeed?

comment:3 Changed 4 years ago by matze

  • Description modified (diff)

Yep.

comment:4 Changed 4 years ago by matze

  • Description modified (diff)

comment:5 Changed 4 years ago by matze

  • Blocked By 2849 added

comment:6 Changed 4 years ago by matze

  • Owner set to matze

comment:7 Changed 4 years ago by matze

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing

comment:8 Changed 4 years ago by matze

  • Resolution set to fixed
  • Status changed from reviewing to closed
Note: See TracTickets for help on using tickets.