We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3fcaf79 commit fde1d22Copy full SHA for fde1d22
1 file changed
lib/CleantalkSP/SpbctWP/Scanner/Surface.php
@@ -499,7 +499,17 @@ public function countFilesInDir($main_path)
499
\RecursiveIteratorIterator::SELF_FIRST
500
);
501
502
+ if (defined('SPBC_MAX_EXECUTION_TIME') && is_numeric(SPBC_MAX_EXECUTION_TIME)) {
503
+ $max_execution_time = SPBC_MAX_EXECUTION_TIME;
504
+ $start_time = time();
505
+ }
506
+
507
foreach ($iterator as $fileInfo) {
508
509
+ if ((time() - $start_time) > $max_execution_time) {
510
+ break;
511
512
513
try {
514
if ($fileInfo->isLink()) {
515
continue; // Skip symlinks
0 commit comments