Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
open-source
MetaGer
Commits
8a3ba5c5
Commit
8a3ba5c5
authored
Sep 09, 2016
by
Dominik Hebeler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug behoben bei dem versucht wurde einen nicht vorhandenen Stream zu schließen.
parent
3e2d81fe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
app/Jobs/Search.php
app/Jobs/Search.php
+9
-6
No files found.
app/Jobs/Search.php
View file @
8a3ba5c5
...
...
@@ -73,7 +73,6 @@ class Search extends Job implements ShouldQueue
if
(
sizeof
((
$tmp
=
explode
(
": "
,
$data
)))
===
2
)
{
$headers
[
strtolower
(
trim
(
$tmp
[
0
]))]
=
trim
(
$tmp
[
1
]);
}
$c
++
;
}
while
(
true
);
...
...
@@ -230,7 +229,7 @@ class Search extends Job implements ShouldQueue
$timeElapsed
=
microtime
(
true
)
-
$time
;
if
(
$timeElapsed
>
0.5
)
{
# Irgendwas ist mit unserem Socket passiert. Wir brauchen einen neuen:
if
(
$this
->
fp
)
{
if
(
$this
->
fp
&&
is_resource
(
$this
->
fp
)
)
{
fclose
(
$this
->
fp
);
}
...
...
@@ -244,10 +243,8 @@ class Search extends Job implements ShouldQueue
$tmp
=
fwrite
(
$this
->
fp
,
$string
);
}
catch
(
\
ErrorException
$e
)
{
# Irgendwas ist mit unserem Socket passiert. Wir brauchen einen neuen:
try
{
if
(
$this
->
fp
&&
is_resource
(
$this
->
fp
))
{
fclose
(
$this
->
fp
);
}
catch
(
\
ErrorException
$e
)
{
}
Redis
::
del
(
$this
->
name
.
"."
.
$this
->
socketNumber
);
...
...
@@ -266,9 +263,11 @@ class Search extends Job implements ShouldQueue
}
}
if
(
$sent
===
strlen
(
$out
))
{
return
true
;
}
return
false
;
}
...
...
@@ -283,6 +282,7 @@ class Search extends Job implements ShouldQueue
# 1. Stelle fest, ob dieser Socket neu erstellt wurde, oder ob ein existierender geöffnet wurde.
$counter
=
0
;
$fp
=
null
;
$time
=
microtime
(
true
);
do
{
if
(
intval
(
Redis
::
exists
(
$this
->
host
.
".
$counter
"
))
===
0
)
{
...
...
@@ -300,7 +300,10 @@ class Search extends Job implements ShouldQueue
stream_set_blocking
(
$fp
,
0
);
$string
=
fgets
(
$fp
,
8192
);
if
(
$string
!==
false
||
feof
(
$fp
))
{
fclose
(
$fp
);
if
(
$this
->
fp
&&
is_resource
(
$this
->
fp
))
{
fclose
(
$fp
);
}
continue
;
}
break
;
...
...
Write
Preview
Markdown
is supported
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