New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move Request::cleanExpiredUnconfirmedRequests to maintenance script #452
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code does not verify
@@ -20,6 +20,10 @@ | |||
":mail" => $cDataClearEmail | |||
)); | |||
|
|||
if ($enableEmailConfirm == 1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code will cause a syntax error because you didn't add $enableEmailConfirm
to the global
directive on line 15. Please remember to test your code to avoid issues like this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correction, not a syntax error, but an undefined variable error.
Codecov Report
@@ Coverage Diff @@
## master #452 +/- ##
=======================================
Coverage 20.54% 20.54%
=======================================
Files 9 9
Lines 584 584
=======================================
Hits 120 120
Misses 464 464 Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, will test properly when I have a more stable internet connection to test with.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good, though it needs testing before approval
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MariaDB [(none)]> use waca_production;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
MariaDB [waca_production]> select count(*) from request where ip <> '127.0.0.1' and emailconfirm <> 'Confirmed';
+----------+
| count(*) |
+----------+
| 210 |
+----------+
1 row in set (0.01 sec)
MariaDB [waca_production]> select count(*) from request where ip <> '127.0.0.1' and status = 'Closed';
+----------+
| count(*) |
+----------+
| 590 |
+----------+
1 row in set (0.00 sec)
MariaDB [waca_production]> select 'running ClearOldData.php script' from dual;
+---------------------------------+
| running ClearOldData.php script |
+---------------------------------+
| running ClearOldData.php script |
+---------------------------------+
1 row in set (0.00 sec)
MariaDB [waca_production]> select count(*) from request where ip <> '127.0.0.1' and emailconfirm <> 'Confirmed';
+----------+
| count(*) |
+----------+
| 0 |
+----------+
1 row in set (0.00 sec)
MariaDB [waca_production]> select count(*) from request where ip <> '127.0.0.1' and status = 'Closed';
+----------+
| count(*) |
+----------+
| 0 |
+----------+
1 row in set (0.00 sec)
MariaDB [waca_production]> \t
C:\apps\php\5.6.24-nts-VC11-x86\php.exe C:\Users\stwalkerster\Projects\wikipedia-account-creation-tool-2\ClearOldData.php
Deletion complete.
Process finished with exit code 0
Tests fine on my old sanitised production clone, where everything is over the dataclear interval.
#451