Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MetaGer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open-source
MetaGer
Commits
8f4c5b2c
Commit
8f4c5b2c
authored
8 years ago
by
Dominik Hebeler
Browse files
Options
Downloads
Patches
Plain Diff
Bug behoben bei dem versucht wurde einen nicht vorhandenen Stream zu schließen.
parent
a16f16fa
No related branches found
Branches containing commit
No related tags found
1 merge request
!1365
Resolve "Filter Options for MetaGer"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/Jobs/Search.php
+9
-6
9 additions, 6 deletions
app/Jobs/Search.php
with
9 additions
and
6 deletions
app/Jobs/Search.php
+
9
−
6
View file @
8f4c5b2c
...
...
@@ -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
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment