From bcb61a67d308f65d4e68f715e06f346ddfdf2d51 Mon Sep 17 00:00:00 2001 From: Nao Date: Sat, 22 Jul 2017 11:12:20 +0200 Subject: [PATCH] * Simplified a query. (Memberlist.php) * PHP caching code was probably a bit too greedy. Wait time after uploading a file was reduced to 2 seconds max, with perfect results on my sometimes busy server. (Subs-CachePHP.php) --- core/app/Memberlist.php | 2 +- core/app/Subs-CachePHP.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/app/Memberlist.php b/core/app/Memberlist.php index c4a46574..dc186c8d 100644 --- a/core/app/Memberlist.php +++ b/core/app/Memberlist.php @@ -405,7 +405,7 @@ function MLSearch() FROM {db_prefix}custom_fields WHERE active = {int:active} AND can_search = {int:can_search} - AND (field_type = {literal:text} OR field_type = {literal:textarea})', + AND field_type IN ({literal:text}, {literal:textarea})', array( 'active' => 1, 'can_search' => 1, diff --git a/core/app/Subs-CachePHP.php b/core/app/Subs-CachePHP.php index 4f115b4b..73aa8b6b 100644 --- a/core/app/Subs-CachePHP.php +++ b/core/app/Subs-CachePHP.php @@ -18,7 +18,7 @@ function cache_source_file($source, $dest) // First of all, make sure we're not caching a partially uploaded file. Give it a few seconds to finish. $tries = 8; clearstatcache(true, $source); - while (time() - filemtime($source) < 3 && $tries--) + while (time() - filemtime($source) < 2 && $tries--) { sleep(1); clearstatcache(true, $source);