Merge pull request #3280 from aspendigital/settings-queue-restart
Trigger queue worker restart on settings model save
This commit is contained in:
commit
33d492fda7
|
|
@ -1,6 +1,7 @@
|
|||
<?php namespace System\Behaviors;
|
||||
|
||||
use App;
|
||||
use Artisan;
|
||||
use Cache;
|
||||
use System\Classes\ModelBehavior;
|
||||
use ApplicationException;
|
||||
|
|
@ -196,12 +197,14 @@ class SettingsModel extends ModelBehavior
|
|||
}
|
||||
|
||||
/**
|
||||
* After the model is saved, clear the cached query entry.
|
||||
* After the model is saved, clear the cached query entry
|
||||
* and restart queue workers so they have the latest settings
|
||||
* @return void
|
||||
*/
|
||||
public function afterModelSave()
|
||||
{
|
||||
Cache::forget($this->getCacheKey());
|
||||
Artisan::call('queue:restart');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue