Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
open-source
MetaGer
Commits
b72aa5ec
Commit
b72aa5ec
authored
Feb 22, 2018
by
Dominik Hebeler
Browse files
Fehler in den Fetchern behoben, der erhöhte Ladezeiten verursacht haben könnte.
parent
d2f31819
Changes
2
Show whitespace changes
Inline
Side-by-side
app/Jobs/Searcher.php
View file @
b72aa5ec
...
@@ -15,7 +15,11 @@ class Searcher implements ShouldQueue
...
@@ -15,7 +15,11 @@ class Searcher implements ShouldQueue
use
InteractsWithQueue
,
Queueable
,
SerializesModels
;
use
InteractsWithQueue
,
Queueable
,
SerializesModels
;
protected
$name
,
$ch
,
$pid
,
$counter
,
$lastTime
,
$connectionInfo
;
protected
$name
,
$ch
,
$pid
,
$counter
,
$lastTime
,
$connectionInfo
;
# Each Searcher will shutdown after a specified time(s) or number of requests
protected
$MAX_REQUESTS
=
100
;
protected
$MAX_REQUESTS
=
100
;
# This value should always be below the retry_after value in config/queue.php
protected
$MAX_TIME
=
240
;
protected
$startTime
=
null
;
protected
$importantEngines
=
array
(
"Fastbot"
,
"overture"
,
"overtureAds"
);
protected
$importantEngines
=
array
(
"Fastbot"
,
"overture"
,
"overtureAds"
);
protected
$recheck
;
protected
$recheck
;
...
@@ -35,6 +39,7 @@ class Searcher implements ShouldQueue
...
@@ -35,6 +39,7 @@ class Searcher implements ShouldQueue
$this
->
name
=
$name
;
$this
->
name
=
$name
;
$this
->
pid
=
getmypid
();
$this
->
pid
=
getmypid
();
$this
->
recheck
=
false
;
$this
->
recheck
=
false
;
$this
->
startTime
=
microtime
(
true
);
// Submit this worker to the Redis System
// Submit this worker to the Redis System
Redis
::
expire
(
$this
->
name
,
5
);
Redis
::
expire
(
$this
->
name
,
5
);
}
}
...
@@ -91,7 +96,9 @@ class Searcher implements ShouldQueue
...
@@ -91,7 +96,9 @@ class Searcher implements ShouldQueue
// In sync mode every Searcher may only retrieve one result because it would block
// In sync mode every Searcher may only retrieve one result because it would block
// the execution of the remaining code otherwise:
// the execution of the remaining code otherwise:
if
(
getenv
(
"QUEUE_DRIVER"
)
===
"sync"
||
$this
->
counter
>
$this
->
MAX_REQUESTS
){
if
(
getenv
(
"QUEUE_DRIVER"
)
===
"sync"
||
$this
->
counter
>
$this
->
MAX_REQUESTS
||
(
microtime
(
true
)
-
$this
->
startTime
)
>
$this
->
MAX_TIME
){
break
;
break
;
}
}
}
}
...
...
config/queue.php
View file @
b72aa5ec
...
@@ -61,7 +61,7 @@ return [
...
@@ -61,7 +61,7 @@ return [
'driver'
=>
'redis'
,
'driver'
=>
'redis'
,
'connection'
=>
'default'
,
'connection'
=>
'default'
,
'queue'
=>
'default'
,
'queue'
=>
'default'
,
'retry_after'
=>
9
0
,
'retry_after'
=>
30
0
,
],
],
],
],
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment