Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release/3.2.16' into v3
- Loading branch information
Showing
11 changed files
with
108 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<?php | ||
/** | ||
* SEOmatic plugin for Craft CMS 3.x | ||
* | ||
* A turnkey SEO implementation for Craft CMS that is comprehensive, powerful, | ||
* and flexible | ||
* | ||
* @link https://nystudio107.com | ||
* @copyright Copyright (c) 2017 nystudio107 | ||
*/ | ||
|
||
namespace nystudio107\seomatic\helpers; | ||
|
||
use nystudio107\seomatic\Seomatic; | ||
|
||
use Craft; | ||
use craft\helpers\App; | ||
use craft\queue\QueueInterface; | ||
|
||
/** | ||
* @author nystudio107 | ||
* @package Seomatic | ||
* @since 3.2.16 | ||
*/ | ||
class Queue | ||
{ | ||
// Constants | ||
// ========================================================================= | ||
|
||
// Static Methods | ||
// ========================================================================= | ||
|
||
/** | ||
* Run the queue if we can run it via the web interface | ||
* | ||
* @return void | ||
*/ | ||
public static function run() | ||
{ | ||
$queue = Craft::$app->getQueue(); | ||
// Make sure the queue uses the Craft web interface | ||
if (!$queue instanceof QueueInterface) { | ||
return; | ||
} | ||
|
||
// Make sure Craft is configured to run queues over the web | ||
if (!Craft::$app->getConfig()->getGeneral()->runQueueAutomatically) { | ||
return; | ||
} | ||
|
||
// Make sure the queue isn't already running, and there are waiting jobs | ||
if ($queue->getHasReservedJobs() || !$queue->getHasWaitingJobs()) { | ||
return; | ||
} | ||
|
||
// Run the queue | ||
App::maxPowerCaptain(); | ||
$queue->run(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters