-
Notifications
You must be signed in to change notification settings - Fork 344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #75 - Cleanup stale file handle #92
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,6 +36,7 @@ import ( | |
func GatherResults(waitfile string, url string) error { | ||
var inputFileName []byte | ||
var err error | ||
var outfile *os.File | ||
|
||
// just loop looking for a file. | ||
done := false | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I know this is out of scope, but what about for { There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Patches welcome ;-) |
||
|
@@ -60,9 +61,16 @@ func GatherResults(waitfile string, url string) error { | |
url += "." + filenameParts[1] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. line 45: inputFileName is misleading, it's not the name of a file, it's the contents of waitfile. |
||
} | ||
|
||
defer func() { | ||
if outfile != nil { | ||
outfile.Close() | ||
} | ||
}() | ||
|
||
// transmit back the results file. | ||
return DoRequest(url, func() (io.Reader, error) { | ||
outfile, err := os.Open(s) | ||
outfile, err = os.Open(s) | ||
return outfile, errors.WithStack(err) | ||
}) | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete this line, use err := on line 65