File tree 3 files changed +12
-2
lines changed
3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 6
6
7
7
use Illuminate \Console \Command ;
8
8
use Illuminate \Support \Collection ;
9
+ use Matchish \ScoutElasticSearch \ElasticSearch \Config \Config ;
9
10
use Matchish \ScoutElasticSearch \Jobs \Import ;
10
11
use Matchish \ScoutElasticSearch \Jobs \QueueableJob ;
11
12
use Matchish \ScoutElasticSearch \Searchable \ImportSource ;
@@ -48,11 +49,11 @@ private function import(string $searchable): void
48
49
$ sourceFactory = app (ImportSourceFactory::class);
49
50
$ source = $ sourceFactory ::from ($ searchable );
50
51
$ job = new Import ($ source );
51
- $ job ->timeout = config ( ' elasticsearch.queue.timeout ' );
52
+ $ job ->timeout = Config:: queueTimeout ( );
52
53
53
54
if (config ('scout.queue ' )) {
54
55
$ job = (new QueueableJob ())->chain ([$ job ]);
55
- $ job ->timeout = config ( ' elasticsearch.queue.timeout ' );
56
+ $ job ->timeout = Config:: queueTimeout ( );
56
57
}
57
58
58
59
$ bar = (new ProgressBarFactory ($ this ->output ))->create ();
Original file line number Diff line number Diff line change 8
8
* @method static password()
9
9
* @method static elasticCloudId()
10
10
* @method static apiKey()
11
+ * @method static queueTimeout()
11
12
*/
12
13
class Config
13
14
{
Original file line number Diff line number Diff line change @@ -63,6 +63,14 @@ public function apiKey(): ?string
63
63
return $ this ->loadConfig ('api_key ' );
64
64
}
65
65
66
+ /**
67
+ * @return ?int
68
+ */
69
+ public function queueTimeout (): ?int
70
+ {
71
+ return (int ) $ this ->loadConfig ('queue.timeout ' ) ?: null ;
72
+ }
73
+
66
74
/**
67
75
* @param string $path
68
76
* @return mixed
You can’t perform that action at this time.
0 commit comments