Skip to content

Commit

Permalink
WR #452436: Backport 'hasoverlapped' check.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason Den Dulk authored and brendanheywood committed Feb 5, 2025
1 parent c248b74 commit 4a3101e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion classes/web_processor.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ class web_processor implements processor {
protected $partialsave;
/** @var bool */
protected static $isinsideprocess = false;
/** @var bool */
protected $hasoverlapped = false;

/**
* Construct the web processor.
Expand Down Expand Up @@ -80,7 +82,9 @@ public function init(manager $manager) {

if ($this->partialsave) {
$manager->get_timer()->setCallback(function () use ($manager) {
$this->process($manager, false);
if (!$this->hasoverlapped) {
$this->process($manager, false);
}
});
}

Expand Down Expand Up @@ -116,6 +120,7 @@ public function process(manager $manager, bool $isfinal) {
// We want to prevent doubling up of processing, so skip if an existing process is still executing.
// The profile logs will be kept and processed the next time.
if (self::$isinsideprocess) {
$this->hasoverlapped = true;
debugging('tool_excimer: starting web_processor::process when previous process has not yet finished');
return;
}
Expand Down

0 comments on commit 4a3101e

Please sign in to comment.