Fix issue where entry observer was taking too long during draw. No need to update doublers just to run the draw.
This commit is contained in:
parent
8f41af74f9
commit
8a2b2256cf
|
|
@ -6,6 +6,7 @@ use App\Actions\Tabulation\DoublerSync;
|
||||||
use App\Models\Audition;
|
use App\Models\Audition;
|
||||||
use App\Models\Doubler;
|
use App\Models\Doubler;
|
||||||
use App\Models\Entry;
|
use App\Models\Entry;
|
||||||
|
use Illuminate\Support\Facades\Request;
|
||||||
|
|
||||||
use function auditionSetting;
|
use function auditionSetting;
|
||||||
|
|
||||||
|
|
@ -50,9 +51,11 @@ class EntryObserver
|
||||||
*/
|
*/
|
||||||
public function updated(Entry $entry): void
|
public function updated(Entry $entry): void
|
||||||
{
|
{
|
||||||
$syncer = app(DoublerSync::class);
|
if (Request::route()->getName() !== 'admin.draw.store') { // Don't update doubler table during draw
|
||||||
// Update doubler table when an entry is updated
|
$syncer = app(DoublerSync::class);
|
||||||
$syncer();
|
// Update doubler table when an entry is updated
|
||||||
|
$syncer();
|
||||||
|
}
|
||||||
|
|
||||||
// Log entry changes
|
// Log entry changes
|
||||||
$message = 'Updated Entry #'.$entry->id;
|
$message = 'Updated Entry #'.$entry->id;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue