Skip to content

Commit f8e3a91

Browse files
committed
- Fix Maintenance.php require to it'll work when run from any user.
- Lower the amount of users cleaned up per run.
1 parent 4a06993 commit f8e3a91

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

server/Maintenance.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
along with this program. If not, see <https://www.gnu.org/licenses/>.
1818
*/
1919

20-
require_once("bootstrap.php");
20+
require_once(__DIR__ . "/bootstrap.php");
2121

2222
if (!isCLI()) {
2323
exit("cli only, bye.");
@@ -33,15 +33,14 @@
3333
$api->connect();
3434
$db = $api->getDB();
3535

36-
// TODO: Write flag for if this is done or not.
3736
$runCount = 0;
3837
$deletedCount = 0;
3938
while (true) {
4039
// Delete temporary users, and their private patterns, when they have no session.
4140
$users = $db->execute("SELECT u.id as userId
4241
FROM users as u
4342
LEFT JOIN sessions as s ON s.userId=u.id
44-
WHERE u.type='temporary' && s.id IS NULL LIMIT 100000");
43+
WHERE u.type='temporary' && s.id IS NULL LIMIT 10000");
4544

4645
$tmpUserCount = count($users);
4746

0 commit comments

Comments
 (0)