Merge pull request #3280 from aspendigital/settings-queue-restart

Trigger queue worker restart on settings model save
This commit is contained in:
Samuel Georges 2017-12-19 09:12:12 +11:00 committed by GitHub
commit 33d492fda7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -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');
}
/**