Successfully clean up expired old tokens. - Bug,Optimisation

Report bugs and workarounds
Post Reply
Michaelv
Posts: 16
Joined: 29 Apr 2014 14:01

Successfully clean up expired old tokens. - Bug,Optimisation

Post by Michaelv »

Hi,

Just to suggest.
I'm not sure what these tokens are used for In database EFA->Tokens
Or how fast they create. The clean up script cleans them of records more then 3 days.

It maybe useful to do a "optimize table tokens" at the end of the operation.
This is to reduce fragmentation of the tokens.

Also I'm not sure this is working.

In my system
mysql> select * from tokens;
+----------------------------------+---------------------+
| token | datestamp |
+----------------------------------+---------------------+
| c32a752bbb04021deb3476305c161d1a | 2014-04-29 17:53:13 |
| 9881e629081fdd785936e44d874cb64f | 2014-04-29 18:00:38 |
| bf278382bb4b6ecf79d969b2ca3c2e11 | 2014-04-29 18:31:35 |
| 82ff30b856d52f79ad7f83c6204d0a8b | 2014-04-29 22:22:25 |
| be963bb38c620d9eed21edc2e1918d4b | 2014-04-29 22:29:51 |
| eb9a501418bd9671a7cfda3dedf2cce6 | 2014-04-30 00:26:56 |
| 23c8acbafe594311c83ebde7c8d0d3ab | 2014-04-30 00:28:53 |
| 5e3b88cd3e6aaf5dbf25ea0dccfd98b0 | 2014-04-30 00:36:34 |
| 246890246ac12a2016c9d5f52e7f1e0e | 2014-04-30 02:49:54 |

...

| 094fa80f7acdef754f5ed6392295a4e3 | 2014-05-09 00:19:58 |
| 8f7b06a4bf625abbab39ba0647bd26dc | 2014-05-09 05:05:13 |
| 48d0faeb578d249c42e04458667bddbe | 2014-05-09 05:35:05 |
| fb6a9951e20a7a4aa82fbbe00d146c65 | 2014-05-09 07:12:11 |
| 7c865b28b7956536b687dae2594c5227 | 2014-05-09 08:41:35 |
+----------------------------------+---------------------+

For some reason its not deleting more then 3days.
I think this sql command is wrong. "$sql = "DELETE from tokens WHERE datestamp < DATE_SUB(NOW() , INTERVAL 3 DAYS)";"
It should be DAY not DAYS. Changing it on my system, the deletion works.

Regards,

Michael
buzzzo
Posts: 94
Joined: 03 Feb 2014 09:09

Re: Successfully clean up expired old tokens. - Bug,Optimisa

Post by buzzzo »

Tokens are user by mailscanner custom action to mark email and permit later from your mail client to learn it from gci script.
Said that, your perfectly right: sql syntax in EFA-Tokens-Cron is wrong.

Thx
Post Reply