Skip to content

Commit

Permalink
* Simplified a query. (Memberlist.php)
Browse files Browse the repository at this point in the history
* 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)
  • Loading branch information
Nao committed Jul 22, 2017
1 parent 0c3cd07 commit bcb61a6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/app/Memberlist.php
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion core/app/Subs-CachePHP.php
Expand Up @@ -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);
Expand Down

0 comments on commit bcb61a6

Please sign in to comment.