Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php
2
 
3
namespace Illuminate\Queue\Console;
4
 
5
use Illuminate\Console\Command;
6
use Illuminate\Contracts\Cache\Repository as Cache;
7
use Illuminate\Support\InteractsWithTime;
8
use Symfony\Component\Console\Attribute\AsCommand;
9
 
10
#[AsCommand(name: 'queue:restart')]
11
class RestartCommand extends Command
12
{
13
    use InteractsWithTime;
14
 
15
    /**
16
     * The console command name.
17
     *
18
     * @var string
19
     */
20
    protected $name = 'queue:restart';
21
 
22
    /**
23
     * The name of the console command.
24
     *
25
     * This name is used to identify the command during lazy loading.
26
     *
27
     * @var string|null
28
     *
29
     * @deprecated
30
     */
31
    protected static $defaultName = 'queue:restart';
32
 
33
    /**
34
     * The console command description.
35
     *
36
     * @var string
37
     */
38
    protected $description = 'Restart queue worker daemons after their current job';
39
 
40
    /**
41
     * The cache store implementation.
42
     *
43
     * @var \Illuminate\Contracts\Cache\Repository
44
     */
45
    protected $cache;
46
 
47
    /**
48
     * Create a new queue restart command.
49
     *
50
     * @param  \Illuminate\Contracts\Cache\Repository  $cache
51
     * @return void
52
     */
53
    public function __construct(Cache $cache)
54
    {
55
        parent::__construct();
56
 
57
        $this->cache = $cache;
58
    }
59
 
60
    /**
61
     * Execute the console command.
62
     *
63
     * @return void
64
     */
65
    public function handle()
66
    {
67
        $this->cache->forever('illuminate:queue:restart', $this->currentTime());
68
 
69
        $this->components->info('Broadcasting queue restart signal.');
70
    }
71
}