If using database, don't call plugin task scheduling until initial system migration runs. (#3712)
Fixes #3208. Replaces #3706. Credit to @jimcottrell
This commit is contained in:
parent
cef21fc419
commit
e2c89fb3a2
|
|
@ -14,6 +14,7 @@ use System\Classes\ErrorHandler;
|
|||
use System\Classes\MarkupManager;
|
||||
use System\Classes\PluginManager;
|
||||
use System\Classes\SettingsManager;
|
||||
use System\Classes\UpdateManager;
|
||||
use System\Twig\Engine as TwigEngine;
|
||||
use System\Twig\Loader as TwigLoader;
|
||||
use System\Twig\Extension as TwigExtension;
|
||||
|
|
@ -208,6 +209,11 @@ class ServiceProvider extends ModuleServiceProvider
|
|||
* Allow plugins to use the scheduler
|
||||
*/
|
||||
Event::listen('console.schedule', function ($schedule) {
|
||||
// Fix initial system migration with plugins that use settings for scheduling - see #3208
|
||||
if (App::hasDatabase() && !Schema::hasTable(UpdateManager::instance()->getMigrationTableName())) {
|
||||
return;
|
||||
}
|
||||
|
||||
$plugins = PluginManager::instance()->getPlugins();
|
||||
foreach ($plugins as $plugin) {
|
||||
if (method_exists($plugin, 'registerSchedule')) {
|
||||
|
|
|
|||
|
|
@ -1002,11 +1002,10 @@ class UpdateManager
|
|||
return base64_encode(hash_hmac('sha512', http_build_query($data, '', '&'), base64_decode($secret), true));
|
||||
}
|
||||
|
||||
//
|
||||
// Internals
|
||||
//
|
||||
|
||||
protected function getMigrationTableName()
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getMigrationTableName()
|
||||
{
|
||||
return Config::get('database.migrations', 'migrations');
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue