Module is tracking actions and log these on Event Track dashboard. But these logs are not getting deleting on CRON run. I have setup the Timespan field value to 1 day. I ran cron manually multiple times and also waited for automatic cron run, but logs older than 1 day are not getting deleted.

I have tried to debug this. Cron hook is getting called and its calling getOldRecords to query DB to get all old records and deleteOldRecords to set batch and calling processOldRecords function to which has delete query. This method processOldRecords is not getting called. Thats why logs are not getting deleted.

CommentFileSizeAuthor
#4 3384451-4.patch535 byteschandreshgiri gauswami
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

pankajsachdeva created an issue. See original summary.

samitk’s picture

Assigned: Unassigned » samitk
Status: Active » Needs work

I am working on it.

rushikesh raval’s picture

@samit.310@gmail.com are working on this issue ?
if not then unassigned it so other can work on it.

chandreshgiri gauswami’s picture

Assigned: samitk » Unassigned
Status: Needs work » Needs review
StatusFileSize
new535 bytes

Attaching the patch.

smustgrave’s picture

Status: Needs review » Needs work

That's incorrect, should be using dependency injection.

And why are we making it static?

chandreshgiri gauswami’s picture

Because batch_process function requires static callable method as an argument and if we make processOldRecords() method static, we can't use $this->database inside it. So had to remove dependency injection.

chandreshgiri gauswami’s picture

Status: Needs work » Needs review
smustgrave’s picture

Sorry but think we need to find another way without dropping dependency injection

smustgrave’s picture

Status: Needs review » Needs work
smustgrave’s picture

Version: 3.1.6 » 3.0.x-dev

  • smustgrave committed ef5bac23 on 3.0.x
    Issue #3384451: Event track logs are not getting deleted on cron run.
    
smustgrave’s picture

Status: Needs work » Fixed
smustgrave’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.