3

I'm having a laravel setup with the Clockwork installed. And I have a artisan command that takes really long time to run, so that clockwork will consume too much memory. I still need that extension. How can I disable it when just running a command?

Konstantin Bodnia
  • 1,372
  • 3
  • 20
  • 43

2 Answers2

1

you can override this in the config file clockwork.php

run php artisan vendor:publish --provider='Clockwork\Support\Laravel\ClockworkServiceProvider'

then apply your condition on 'enable'

mygeea
  • 463
  • 3
  • 10
1

You could try:

  1. Publish the clockwork.php configuration file:
    I.e: Run the command:
php artisan vendor:publish --provider='Clockwork\Support\Laravel\ClockworkServiceProvider'

Then it will give you a clockwork config file (config/clockwork.php).

  1. Use the script below to temporarily disable and re-enable clockwork after your "data-intense" commands.

config()->set('clockwork.enable', false);

//  A few data-intense commands here...

config()->set('clockwork.enable', true);

steven7mwesigwa
  • 5,701
  • 3
  • 20
  • 34